(→Interfacing) |
|||
| (17 intermediate revisions by 3 users not shown) | |||
| Line 6: | Line 6: | ||
= Instructions = | = Instructions = | ||
| + | |||
| + | == Important information: Reverse Proxies == | ||
| + | |||
| + | Single Sign-On (SSO) offers benefits beyond reusing a central account, such as ensuring only the identity provider and browser see user credentials, enforcing two-factor authentication (2FA), and shielding intranet servers via reverse proxy checking for valid SSO sessions. Organizations often secure HTTPS interactions by ensuring requests carry a session cookie or bearer token from the identity provider, otherwise redirecting requests to the identity provider. | ||
| + | |||
| + | {{UBIK}} supports this, too, by providing the SSO bearer token within the "Authorization" header for every request. A reverse proxy can verify this token or prevent access otherwise. Unfortunately, Microsoft Entry Application Proxy - even with the helpful-sounding "header-based SSO" configuration - is unable to just check this header without dropping the data when forwarding the incoming message to {{UBIK}}. Hence, with the Microsoft Entra Application Proxy the only way is to deactivate the check. Also, any method checking the session cookie is doomed to fail because for the backchannel, {{UBIK}} doesn't have any access to the browser's cookies, just to the SSO token. | ||
| + | |||
| + | {{Hint|With Microsoft Entra Application Proxy, it is necessary to exclude {{UBIK}} web service URLs from the 2FA redirect rules!}} | ||
| + | |||
| + | If there are further questions, support is available to help. | ||
== Login == | == Login == | ||
| Line 31: | Line 41: | ||
With this, the {{UBIK}} session in the web service's {{UBIK}} Environment is tagged with the SSO token, and the customizing code can use it to interact with 3rd party systems. | With this, the {{UBIK}} session in the web service's {{UBIK}} Environment is tagged with the SSO token, and the customizing code can use it to interact with 3rd party systems. | ||
| − | + | ||
| − | + | ||
| − | + | ||
= Studio = | = Studio = | ||
| Line 102: | Line 112: | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
<syntaxhighlight lang="csharp" > | <syntaxhighlight lang="csharp" > | ||
| − | public class MyOIDCProcessor : DynamicOIDCProcessorExt | + | public class MyOIDCProcessor : UBIK.SSO.OIDCProcessor.DynamicOIDCProcessorExt |
{ | { | ||
// Example for a claim type identifier used to get a value from the Assertions() dictionary. | // Example for a claim type identifier used to get a value from the Assertions() dictionary. | ||
| Line 110: | Line 120: | ||
{ } | { } | ||
| − | protected override Login CreateLogin(string loginName, string domain, OSTypes osType) | + | protected override Login CreateLogin(string loginName, string domain, UBIK.Service.DTO.V220.OSTypes osType) |
{ | { | ||
// In this example, we use the default login creation, but add the email address as the human-readable login name. | // In this example, we use the default login creation, but add the email address as the human-readable login name. | ||
| Line 118: | Line 128: | ||
// The Assertions() method yields a Dictionary<string, object>, where the values usually are strings, too. | // The Assertions() method yields a Dictionary<string, object>, where the values usually are strings, too. | ||
// The keys correspond to the claim type identifiers. | // The keys correspond to the claim type identifiers. | ||
| − | if (Assertions().ContainsKey( | + | if (Assertions().ContainsKey(KEY_MAIL) && !string.IsNullOrEmpty(Assertions()[KEY_MAIL] as string)) |
{ | { | ||
| − | login.Name = Assertions()[ | + | login.Name = Assertions()[KEY_MAIL] as string; |
UBIKKernel.LogCustomizing(MethodBase.GetCurrentMethod(), | UBIKKernel.LogCustomizing(MethodBase.GetCurrentMethod(), | ||
$"Login name for {login.ID} was set to {login.Name} -> Key: {KEY_MAIL}"); | $"Login name for {login.ID} was set to {login.Name} -> Key: {KEY_MAIL}"); | ||
| Line 139: | Line 149: | ||
{ | { | ||
// Here, we could update groups assignment or other account information. | // Here, we could update groups assignment or other account information. | ||
| + | // If the login object is modified here, please remember to call the login.Save() method before returning! | ||
} | } | ||
return login; | return login; | ||
| Line 152: | Line 163: | ||
</div></div> | </div></div> | ||
| + | |||
| + | |||
| + | |||
| + | |||
== Interfacing == | == Interfacing == | ||
| Line 177: | Line 192: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| + | |||
| + | |||
| + | |||
| + | |||
= Client = | = Client = | ||
| Line 183: | Line 202: | ||
* Set up an identity provider if necessary | * Set up an identity provider if necessary | ||
| − | * Assemble a client configuration JSON string, .e.g.: | + | * Assemble a client configuration JSON string, .e.g. for Entra: |
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
| − | {'AuthorityURL' : 'https:// | + | {'AuthorityURL' : 'https://login.microsoftonline.com/{tenantid}/v2.0', |
| − | 'ClientID' : ' | + | 'ClientID' : '{clientid}', |
'ClientSecret' : null, | 'ClientSecret' : null, | ||
| − | 'RedirectURL' : 'com.augmensys.ubik:// | + | 'RedirectURL' : 'com.augmensys.ubik://sso/', |
'Scope' : 'openid', | 'Scope' : 'openid', | ||
'UseAccessToken' : 'false'} | 'UseAccessToken' : 'false'} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| + | |||
| + | {{Attention|The "RedirectURL" is needed so that the SSO login process can be redirected back to the client after authentication. When using the Mobile clients, the custom protocol ("com.augmensys.ubik://sso/") might trigger a trust warning from some SSO providers (e.g. Entra), asking users to additionally confirm the login. If you want to avoid such warnings, it's possible to configure the so called "universal link" ("https://ubikapp.augmensys.com/sso/") as the RedirectURL instead. {{Version/XamarinSince|4.9}} This is not the case for the UWP client because there's no such trust warning problem and universal link is not properly supported on Windows anyway.}} | ||
| + | |||
| + | {{Hint|When using the universal link as the RedirectURL, the Mobile iOS client needs to open the Safari browser in order to successfully complete the login process. If you see the browser stuck on the {{UBIK}} SSO page and that it does not redirect to the client, please set Safari as the default browser. And the Mobile iOS client opens the Safari browser externally, because we found out that the redirect process requires user interaction even when the user has already previously logged in. (This is in line with what many others also experienced, like described in [https://stackoverflow.com/questions/44706216/universal-link-does-not-work-in-safari this example].) This means there will be a browser instance open in the background after you log in/out using SSO on a Mobile iOS client, which is unfortunately a technical limitation until Apple changes their universal link support.}} | ||
| + | |||
* Integrate client configuration in profile: | * Integrate client configuration in profile: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
| Line 202: | Line 226: | ||
</InternalSSOSettings> | </InternalSSOSettings> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| + | |||
| + | {{Hint|Entra requires a client secret for web applications (to be configured both in Entra as well as in the client profile's OIDC settings described above). For native/mobile applications, the client secret must be null though!}} | ||
| + | |||
| + | |||
| + | |||
| + | |||
== SAML == | == SAML == | ||
| Line 237: | Line 267: | ||
* [[SYSCLS_EXTERNALENTITY|External Entity Classification (SSO)]] | * [[SYSCLS_EXTERNALENTITY|External Entity Classification (SSO)]] | ||
| + | [[Category:Client|Integrate UBIK in an SSO Environment]] | ||
[[Category:How-To|Integrate UBIK in an SSO Environment]] | [[Category:How-To|Integrate UBIK in an SSO Environment]] | ||
| + | [[Category:Mobile|Integrate UBIK in an SSO Environment]] | ||
[[Category:SSO|Integrate UBIK in an SSO Environment]] | [[Category:SSO|Integrate UBIK in an SSO Environment]] | ||
[[Category:Version 3.6|Integrate UBIK in an SSO Environment]] | [[Category:Version 3.6|Integrate UBIK in an SSO Environment]] | ||
| + | [[Category:WinX|Integrate UBIK in an SSO Environment]] | ||
Latest revision as of 15:02, 2 April 2026
Single Sign-On (SSO) allows an end-user to interact with multiple services without logging in more than once.
This page shows how to integrate UBIK® into such an SSO environment.