-
Notifications
You must be signed in to change notification settings - Fork 9
How to set up OpenID Connect Provider configuration in Score
Hakju Oh edited this page Sep 1, 2020
·
2 revisions
The configuration of the Identity Provider (IdP) should be inserted into oauth2_app table and oauth2_app_scope table in the database including the following properties.
- Provider Name (
oauth2_app.provider_namecolumn) – Score’s internal name of the provider. It must be unique. - IdP Endpoint(s):
a. Issuer Endpoint (
oauth2_app.issuer_uricolumn) – an OpenID Connect Provider may provide ‘/.well-known/openid-configuration’ endpoint that returns meta-data of provider’s information. This issuer endpoint is a base endpoint of the provider that supports the Well-Known URI Discovery mechanism. b. Authorization Endpoint, Token Endpoint, User Info Endpoint, and JSON Web Key Set Endpoint (oauth2_app.authorization_uri,oauth2_app.token_uri,oauth2_app.user_info_uri, andoauth2_app.jwk_set_uricolumns, respectively) – These information can be used in case that the provider does not support the Well-Known URI Discovery mechanism. - Redirection URI (
oauth2_app.redirect_uricolumn) – The external IdP should know the redirection URI to send the result of the client sign-in request by OAuth 2.0 flows. This has the following form: ‘{scheme}://{hostname}/api/oauth2/code/{provider_name}’. (‘scheme’: ‘http’ or ‘https’. It may have a specific port number., ‘hostname’: the hostname of Score, ‘provider_name’: defined inprovider_namecolumn.) This value may need to be registered in your IdP configuration. See your IdP documentation for details. - Client ID and Client Secret (
oauth2_app.client_idandoauth2_app.client_secretcolumns) – These are the values issued by IdP for the registered application. See your IdP documentation for details. - Client Authentication Method and Authorization Grant Type (
oauth2_app.client_authentication_methodandoauth2_app.authorization_grant_typecolumns) – Possible values forclient_authentication_methodare ‘basic’ or ‘post’, and for ‘authroization_grant_type’ are ‘authorization_code’, ‘client_credentials’, ‘password’, etc. See your IdP documentation for details.) - (Optional) Prompt Parameter (
oauth2_app.promptcolumn) – Some IdP supports the prompt parameter to provide display options during sign-in process. Typical values for the prompt are ‘none’, ‘login’, ‘consent’. See your IdP documentation for details. - Display provider name, Font color, Background color, and display order (
oauth2_app.display_provider_name,oauth2_app.font_color,oauth2_app.background_color, andoauth2_app.display_ordercolumns, respectively) – These are customizable options for the UI button in Score sign-in page. - Disable Indicator (
oauth2_app.is_disabledcolumn) – If this column sets to 1 (true), the UI button for this provider will not be exposed. Default is 0 (false). - Scope(s) (
oauth2_app_scope.scopecolumn) – OpenID Connect supports several scopes such as ‘openid’, ‘profile’, ‘email’, and ‘phone’. These scopes for the application should insert intooauth2_app_scopetable.
Note that all fields are mandatory except Prompt Parameter. Regarding of IdP Endpoint(s), either a) or b) should be configured. Whenever the property is changed in DB, the application, especially http-gateway, must restart to load changed information. The following is an example query to insert these properties.
INSERT INTO `oauth2_app` (`provider_name`, `issuer_uri`, `redirect_uri`, `client_id`, `client_secret`, `client_authentication_method`, `authorization_grant_type`, `display_provider_name`, `background_color`, `font_color`) VALUES ('google', 'https://accounts.google.com', 'https://example.score.com/api/oauth2/code/google', '506273723586-umjg2hc17g0ggtpju4cd6q3bak19f2tk.apps.googleusercontent.com', 'kDLG5anRHSqc0lz3ZXTSFCqn', 'post', 'authorization_code', 'Google', '#df4930', '#ffffff'); INSERT INTO `oauth2_app_scope` (`oauth2_app_id`, `scope`) VALUES ((SELECT `oauth2_app_id` FROM `oauth2_app` WHERE `provider_name` = 'google'), 'openid'), ((SELECT `oauth2_app_id` FROM `oauth2_app` WHERE `provider_name` = 'google'), 'profile'), ((SELECT `oauth2_app_id` FROM `oauth2_app` WHERE `provider_name` = 'google'), 'email');