OpenID¶
Using these settings we can add OpenID configuration to allow logging into the DSW via external identity provider.
DSW supports Microsoft Azure, ORCID, as well as any other OpenID providers. Following are detailed description of the setups for these options.
Note
After setting a new OpenID service, we should directly test it and verify that the configuration works well. For that, we can simply open our DSW in a new anonymous window of the web browser.
Microsoft Azure Setup¶
Go to https://portal.azure.com/.
Go to
App registrations.Click on
New registration.Fill in a name.
Select
Single tenant only - ....Keep
Redirect URIempty.Click on
Register.Copy and store
Directory (tenant) IDandApplication (client) ID.Click on
Managein the left menu →Certificates & Secrets.Click on
New client secret.Fill description, set
Expiresand note it somewhere, then click onAdd.Copy
Valueand store it somewhere. You will not able to view it again.Go to OpenID in DSW:
Settings→OpenID→Create.Fill in a
Nameof the service. This name will be used to identify the service in the list of login options, so it should be something descriptive.- Open the
Microsofttab and fill in : Application (client) IDDirectory (tenant) IDClient Secret→<stored secret value>
- Open the
(optional) fill Icon (
fab fa-microsoft, or some other from Font Awesome),Background ColorandText Color.Click on
Save.Go back to Microsoft Azure.
Click on
Managein the left menu →Authentication (Preview).Click on
Add Redirect URI.Click on
Web.Copy
Redirect URIandFront-channel logout URLfrom DSW.Do not check any checkbox.
Click on
Configure.Click on
Managein the left menu →API permissions.Click on
Add a permission.Click on
Microsoft Graph→Delegated permissions.Under
OpenId permissionscheckemail,openidandprofile. UnderUserkeep checkedUser.Read.Click on
Add permissions.Click on
Managein the left menu →Token configuration.Click on
Add optional claim.Select
IDand checkemail,family_nameandgiven_name.Click on
Add.Test your OpenID configuration in DSW (You might need to refresh the login page for the login button to appear).
ORCID Setup¶
ORCID requires a redirect URI before it allows us to save the application and obtain credentials. Because DSW generates the callback URL only after the OpenID configuration is saved, we first create the DSW configuration with temporary credentials and then return to ORCID.
Go to OpenID in DSW:
Settings→OpenID→Create.Fill in a
Nameof the service, for exampleORCID.Open the
Customtab.- Fill in temporary values:
Client ID→placeholderClient Secret→placeholderURL→https://orcid.org
Leave
Parametersempty.(optional) fill Icon (
fab fa-orcid),Background Color(#A6CE39), andText Color.Click on
Save.Copy
Callback URLfrom DSW. It will look similar tohttps://<your-domain>/wizard/open-id/<uuid>/callback.Go to https://orcid.org/signin and sign in to ORCID.
Open
Developer Toolsfrom the account menu.If this is the first application, register for ORCID Public API credentials.
- Fill in the application details:
Name→ name of the DSW instance or organization.Application URL→ public URL of the DSW instance.Application Description→ short description of the DSW instance.Redirect URI→ paste theCallback URLcopied from DSW.
Save the application and generate credentials.
Copy
Client IDandClient Secret.Go back to the ORCID OpenID configuration in DSW.
- Replace temporary credentials:
Client ID→ ORCIDClient IDClient Secret→ ORCIDClient SecretURL→ keephttps://orcid.org
Click on
Save.Test your OpenID configuration in DSW (You might need to refresh the login page for the login button to appear).
Note
ORCID uses the term Redirect URI for the DSW Callback URL. The DSW Logout URL does not need to be entered in ORCID Public API credentials.
Note
For ORCID sandbox testing, use https://sandbox.orcid.org/ for ORCID registration and use https://sandbox.orcid.org as the DSW URL.
Custom Setup¶
Go to OpenID in DSW:
Settings→OpenID→Create.Fill in a
Nameof the service. This name will be used to identify the service in the list of login options, so it should be something descriptive.Open the
Customtab.Prepare the OpenID endpoint
URL. This is usually the issuer URL of the provider. If the provider gives us a URL ending with/.well-known/openid-configuration, use only the part before this suffix.- Prepare the client application on the side of the OpenID provider:
If the provider allows creating the client without redirect URLs, create it and obtain
Client IDandClient Secret.If the provider requires redirect URLs before it creates credentials, use temporary values in DSW first, for example
placeholderforClient IDandClient Secret. Fill in the real OpenID endpointURLand click onSave. Then copy the generatedCallback URLfrom DSW and use it in the provider.
- In the OpenID provider, configure redirect URLs:
Use DSW
Callback URLas the provider redirect URI, callback URL, reply URL, or sign-in redirect URI.If the provider supports logout URLs, use DSW
Logout URLas the provider logout URL.
- Configure the client in the OpenID provider:
Allow the
authorization_codeflow, if this is configurable.Configure the client to have the following scopes or claims:
openid,profile,email.Configure the client to provide the following details in ID tokens:
email,given_name,family_name.
Go back to DSW and fill in the real
Client ID,Client Secret, andURLfrom the OpenID provider.Leave
Parametersempty unless the provider documentation requires an additional parameter.(optional) fill Icon (some from Font Awesome),
Background ColorandText Color.Click on
Save.Test your OpenID configuration in DSW (You might need to refresh the login page for the login button to appear).
Advanced Configuration¶
In the Advanced dropdown of the OpenID configuration, we can set up additional options.
Registration enabled - if enabled, users will be able to register a new DSW account using this OpenID service. If disabled, only existing DSW OpenID accounts can log in.
- Scopes - scopes requested from the OpenID provider.
Email - some services (such as ORCID) do not provide an email address. By disabling this option, we can enable email completion upon the user’s first login. This means that if the OpenID provider does not return an email address, the user will be prompted to enter it manually after the first login. DSW requires an email address to send password reset instructions and other notifications, so it is required for the user account.
Profile - if the provider does not return profile information, the user will be prompted to enter their first and last name manually after the first login.