Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
ArmoniK team wanted to know if it was feasible to connect a sso to armonik.
Description
Using the ngx_http_auth_request_module nginx module, the goal is to recreate the flow described in this openid documentation.
A variable has been added, named
oauth_configuration, with the following content:provider_root_URI: Address of the sso service.provider_user_info_endpoint: Endpoint of the sso service that checks user claims and data (generallyuserinfo).provider_authorization_endpoint: Endpoint of the sso service that logs the user and return the associated token or code to the client.client_id: Id of the client registered to the sso service (Represent one endpoint of the client with the oidc mock provider).response_type: represents the way the client awaits the sso service to return user information. Can be a code, a token...Added two location in the ingress configmap :
/auth: use a proxy_pass method to get the claims associated to the user. If the user is not connected, can return either 401 or 403 http errors.authError: location used when the/authfails. Make the user connect and return either a code, refresh_token, access_token... click here for more informationTesting
Testing locally can be done using openId Mock Provider. Just use the command:
To create an instance of an oidc mock provider. It is also available as a docker image.
Next step is to register a valid endpoint and getting a ClientID, by using the command:
curl -XPOST localhost:9400/oauth2/clients \ --json '{"redirect_uris": ["http://${your_armonik_host}:${your_armonik_port}/admin/en/"]}'And use the returned client ID in the
oauth_configurationvariable. In the end, your variable should look like this:This is kinda painfull to know if it is working, since nginx cannot provide the access_token required by the
userinfoendpoint (since only a code can be returned by the service...). From experience, you should not have any nginx error, but you should loop on the /authorize page of the mock service.Checklist