Changes
= Instructions =
* For which types of objects (meta classes) do I need to interact with external systems, requiring SSO authorization?
* For which synchronization operations (e.g., update, commit, create, etc.) do I need authorization?
* Which SSO client configurations (identity provider base URL, scopes, etc.- see "login") are used in this case?
For each resulting combination we have to create an [[SYSCLS_EXTERNALAUTHCONFIG|External Auth Config]] object and give it to the client in the infrastructure list.
Further, we have to make sure the authorization tokens can be transported to the server. Therefore, add the [[SYSCLS_EXTERNALENTITY|External Entity Classification]] to all meta classes of objects that need external authorization.
= Studio =
== Authentication Login ==
* Install the Auth Processor plugin (SAMLProcessor or OIDCProcessor plugin) in your web service's injection folder
* Customize your UBIK Context, overriding the method "GetSSOProcessor" so it returns an instance of the authentication processor:
'''OIDC:'''
</syntaxhighlight>
Instead of "..." you will need to insert the correct URL from your OIDC Provider where the JWKS should originate from.
If the JWKS does not roll periodically:
</syntaxhighlight>
You will need to insert the correct jwks from your OIDC Provider instead of "...".
'''SAML:'''
You will need to load the correct certificate from your SAML Identity Provider instead of null. It's recommended to save the certificate on the server and load it from file storage. The certificate must be the one the IdP uses to sign its SAML responses with.
== Authorization Customizing the SSO processor == There are several use-cases where we need to customize the SSO processor. We can define what should be done when a login object is required or found, and we can use the information delivered with the SSO token in the form of assertions or claims. In any case, we must override the SSO processor implementation, e.g.: <syntaxhighlight lang="csharp">public class MyOIDCProcessor : DynamicOIDCProcessorExt{ // Example for a claim type identifier used to get a value from the Assertions() dictionary. public const string KEY_MAIL = @"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"; public MyOIDCProcessor(UBIKEnvironment environment, string token, string authorityBaseUrl) : base(environment, token, authorityBaseUrl) { } protected override Login CreateLogin(string loginName, string domain, OSTypes osType) { // In this example, we use the default login creation, but add the email address as the human-readable login name. // However, we could also use a special MetaClass for creating the login instance or do anything else we require. Login login = base.CreateLogin(loginName, domain, osType); // The Assertions() method yields a Dictionary<string, object>, where the values usually are strings, too. // The keys correspond to the claim type identifiers. if (Assertions().ContainsKey(Settings.KEY_MAIL) && !string.IsNullOrEmpty(Assertions()[KEY_MAIL] as string)) { login.Name = Assertions()[Settings.KEY_MAIL] as string; UBIKKernel.LogCustomizing(MethodBase.GetCurrentMethod(), $"Login name for {login.ID} was set to {login.Name} -> Key: {KEY_MAIL}"); } return login; } public override string GetLoginID() { // Here, we could influence the login ID used in UBIK, if we have a good mapping. return base.GetLoginID(); } public override Login GetLogin(UBIK.Service.DTO.V220.OSTypes osType) { Login login = base.GetLogin(osType); if (login == null) { // Here, we could update groups assignment or other account information. } return login; } public override bool IsValid() { // Here, we could only accept trusted accounts, for example. return base.IsValid(); }}</syntaxhighlight> == Interfacing ==
* Add [[SYSCLS_EXTERNALAUTHCONFIG|External Auth Config]] objects to the client's infrastructure
* Add the [[SYSCLS_EXTERNALENTITY|External Entity Classification]] to all affected meta class scopes
An external auth config object specifies for which meta class and sync action (e.g., when uploading instruction documents), which SSO configuration should be used. The result of a correct configuration will be, that the client sends an SSO token to the server when performing the sync action for an instance of the meta class. On the server side, you can use that token to interact with the external system. This only works if there is a scope with the external entity classification for that meta class, because it provides the means to transport the token.
= Client =
== OIDC ==
</InternalSSOSettings>
</syntaxhighlight>
== SAML ==
* Set up an identity provider if necessary