#Sample 1 Login with AuthBridge and present the identity provider selector #Sample 2 Login with AuthBridge using Facebook #Sample 3 Login with AuthBridge and normalize user attributes #Sample 4 Login with AuthBridge and send some context information #Sample 5 Login with AuthBridge and send whr as part of the base URL ---- ## Integrate with AuthBridge AuthBridge understands the **WS-Federation** protocol which is used by many Microsoft applications (like SharePoint, CRM) and it's the built-in protocol used in Windows Identity Foundation. ### Login This protocol is really simple. This is the url you have to redirect the user to: ```term https://{authbridge-url}? wa=wsignin1.0 -- signin verb. This is fixed. wtrealm={your-application-identifier} -- logical identifier of your application. This is an arbitrary string with URI format that will have to be added to AuthBridge Web.Config as a scope. wctx={context-information} -- [optional] contextual information that you want to keep around (e.g.: wctx=ru=/home/some-deep-link this would the original url the user was navigating to) whr={identity-provider-identifier} -- [optional] hint AuthBridge to use a specific identity provider (e.g.: whr=urn:Google) ``` For instance, the following link will send the user to login to AuthBridge specifying the identifier for this app (that was previously registered in AuthBridge) https://authbridge.apphb.com/?wa=wsignin1.0&wtrealm=http://sample-with-policyengine/&wctx=ru=/home/myclaims ### Processing the response Once the user logged in using one of the identity providers, AuthBridge will generate a token and will POST it to your application (through the client, not server to server). The default implementation uses SAML 2.0 Tokens. These tokens are cryptographically signed with a private key so that the application can verify that it was generated by someone they trust. You need a library like Windows Identity Foundation to do that. You can use the Windows Identity Foundation SDK which comes with a wizard or this NuGet package ``` Install-Package Auth10.AspNet ``` If you use the NuGet, once it installed, make sure to replace all these values * audienceUri = logical identifier of your application * realm = logical identifier of your application * thumbrpint = thumbprint of the certificate used to sign the token * issuer = AuthBridge url Here is an example for this same application: ```html ```
Fork me on GitHub