Making people work together! Folie 1 NEXPLORE AG Stefan von Niederhäusern Einfache Anwendung der...

Preview:

Citation preview

Making people work together!

Folie 1

NEXPLORE AG

Stefan von Niederhäusern

Einfache Anwendung der SuisseID durch das Software Development KIT

09.09.2010

Making people work together!

Folie 2

Inhalt

• Was ist das SuisseID SDK /.NET• Funktionalität• Unterstützte Anwendungsfälle• Demos

09.09.2010

Making people work together!

Folie 3

Was ist das SuisseID SDK/.NET?

• Ein Software Development Kit (SDK) ist eine Sammlung von Werkzeugen und Anwendungen, um eine Software zu erstellen.

• Toolkit … (englisch für „Werkzeugsatz“) ist ein Begriff aus der elektronischen Datenverarbeitung. Er bezeichnet allgemein eine Sammlung von Bibliotheken, Klassen und Schnittstellen, die das Erstellen von Computerprogrammen vereinfachen sollen. Ziel eines Toolkits ist es, einem Programmierer das Entwickeln von Anwendungen zu erleichtern, indem Standardfunktionen zur Verfügung gestellt werden.

09.09.2010

Making people work together!

Folie 4

Was ist das SuisseID SDK/.NET?

09.09.2010

SuisseID SDK / .NET:Einfach einsetzbare Klassenbibliothek für die Integration von Webapplikationen (ASP.NET) mit der SuisseID Kern-Infrastruktur

Making people work together!

Folie 5

09.09.2010

Positionierung des SuisseID SDK/.NET

Wir befinden uns hier!

Making people work together!

Folie 6

Funktionalität

• Abwicklung der Kommunikation zwischen SuisseID-enabled Applikation und IdP• Erstellen von SAML 2.0 Requests• Signieren von Requests• Verarbeiten von Antworten des IdP• Überprüfung der Signatur der Antworten

• Zugriff auf SuisseID Zertifikat

09.09.2010

Making people work together!

Folie 7

09.09.2010

Making people work together!

Folie 8

09.09.2010

Making people work together!

Folie 9

09.09.2010

UC1: Zertifikatsbasierte Authentifizierung

Making people work together!

Folie 10

09.09.2010

UC2: Abfrage von Attributen beim IdP

Making people work together!

Folie 11

09.09.2010

UC 3: Authentifizierung und Attributabfrage

Making people work together!

Folie 12

Links

09.09.2010

• http://develop.suisseid.ch• Wiki• Download SDKs + Demoapps• Whitepaper

• http://cashback.suisseid.ch/

Making people work together!

Folie 13

Fragen

09.09.2010

Making people work together!

Folie 14

Backup

09.09.2010

Making people work together!

Folie 15

• What is the SuisseID SDK/.NET?• Supported Use Cases• API of the SuisseID SDK/.NET• Code-Examples• Extensions

09.09.2010

Making people work together!

Folie 16

API Goals

• Easy to use• No SAML for the user• Prepared for IoC / Dependency Injection• Expandability possible• Good testability through IoC-Concept• Exception based

09.09.2010

Making people work together!

Folie 17

09.09.2010

API (Certificate)

Making people work together!

Folie 18

09.09.2010

API (IdP Communication)

Making people work together!

Folie 19

09.09.2010

API (Helpers)

Making people work together!

Folie 20

• What is the SuisseID SDK/.NET?• Supported Use Cases• API of the SuisseID SDK/.NET• Code-Examples• Extensions

09.09.2010

Making people work together!

Folie 21

Example Code 1: Build an AuthnRequest (1)

09.09.2010

var request = SuisseIdSdkObjectFactory.GetAuthenticationRequest();

// add claims neededrequest.Claims.Add(

new ClaimDescriptor { Name = CoreClaimTypes.GivenName,

IsRequired = true });

request.Claims.Add(new ClaimDescriptor { Name = CoreClaimTypes.Surname, IsRequired=true });

request.Claims.Add(new ClaimDescriptor { Name = CoreClaimTypes.DateOfBirth, IsRequired = true });

Making people work together!

Folie 22

Example Code 1: Build an AuthnRequest (2)

09.09.2010

// set the endpoint URI from the IdP selectorrequest.Destination = new Uri("http://SelectedIdP");

request.PrivacyNoticeAddress = new Uri("http://PrivacyUrl");

// set return urlrequest.AssertionConsumerServiceUrl =

new Uri("http://DestinationUrl");

 

Making people work together!

Folie 23

Example Code 2: Sending the request to the IdP

09.09.2010

// send the request with the request sendervar requestSender =

SuisseIdSdkObjectFactory.GetRequestSender();

requestSender.UserLanguage = Thread.CurrentThread.CurrentUICulture;

requestSender.SendRequest(request, new HttpContextWrapper(HttpContext.Current)

);

Making people work together!

Folie 24

Example Code 3: Handling the response from the IdP (1)

09.09.2010

// get the responsevar responseHandler = SuisseIdSdkObjectFactory.GetResponseHandler();

// handle responsevar response = responseHandler.HandleResponse(

this.ControllerContext.HttpContext);

 

// get the requested claimsvar claim = response.AllClaims[CoreClaimTypes.IsOver18].Value;

// MISSING: some checks and exception handling

Making people work together!

Folie 25

• What is the SuisseID SDK/.NET?• Supported Use Cases• API of the SuisseID SDK/.NET• Code-Examples• Extensions

09.09.2010

Making people work together!

Folie 26

SuisseID SDK Extensions

• Once authenticated, a user remains authenticated within the application until he explicitly logs out.

• The set of claims is persisted until the user explicitly logs out.

• Developers can use the familiar Principal and Identity objects.

Codesamples and further explanation available in the Microsoft Whitepaper (http://develop.suisseid.ch)

09.09.2010

Making people work together!

Folie 27

SuisseID SDK Extensions

09.09.2010

Making people work together!

Folie 28

Example Code 3: Handling the response from the IdP (1)

09.09.2010

// get the responsevar responseHandler = SuisseIdSdkObjectFactory.GetResponseHandler(); 

try

{

// handle response var response = responseHandler.HandleResponse(

this.ControllerContext.HttpContext); 

// get the requested claims var claim = response.AllClaims[CoreClaimTypes.IsOver18];

 

Making people work together!

Folie 29

Example Code 3: Handling the response from the IdP (2)

09.09.2010

// use claim data

if (claim != null)

{

var value = (bool)claim.Value;

}

catch (StatusAbortedByUserException ex)

{

return this.View("ErrorUserAborted");

}

Recommended