Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
After successful authentication against the OpenShift built-in OAuth provider, retrive the username. Example OAuth Provider configuration, assuming that the Flask application is running in the container on OpenShift: OAUTH_PROVIDERS = [ { "name": "openshift", "icon": "fa-circle-o", "token_key": "access_token", "remote_app": { "client_id": "system:serviceaccount:mynamespace:mysa", "client_secret": "<mysa serviceaccount token here>", "api_base_url": "https://openshift.default.svc.cluster.local:443", "client_kwargs": {"scope": "user:info"}, "redirect_uri": "https://myapp-mynamespace.apps.<cluster_domain>", "access_token_url": "https://oauth-openshift.apps.<cluster_domain>/oauth/token", "authorize_url": "https://oauth-openshift.apps.<cluster_domain>/oauth/authorize", "token_endpoint_auth_method": "client_secret_post" } } ] See also: Using a service account as an OAuth client https://docs.openshift.com/container-platform/4.5/authentication/using-service-accounts-as-oauth-client.html
- Loading branch information
9f1f64d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@noseka1, are you able to explain why the username prefixed with
openshift_
, and not being transparent about the actual username?9f1f64d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh actually, I now see most of the provider implementation prefix it. Except Keycloak :/