Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom authorization server for OKTA client #324

Open
boubou191911 opened this issue Apr 11, 2024 · 0 comments
Open

Support custom authorization server for OKTA client #324

boubou191911 opened this issue Apr 11, 2024 · 0 comments

Comments

@boubou191911
Copy link

OKTA allows to define custom authorization server instead of using the organization authorization server. This is a usual practice when your OKTA server has to support the authorization process of several applications.

The .well-know URL has a different format for those servers. It would be nice to support them as well.

I have unfortunately no time to make a proper pull request. But here would be the code to implement this little change adding a 'auth_Server_id' parameter to the constructoR..

class OktaOAuth2(OpenID):
    def __init__(
        self,
        client_id: str,
        client_secret: str,
        okta_domain: str,
        auth_server_id: Optional[str] = None,
        scopes: Optional[List[str]] = BASE_SCOPES,
        name: str = "okta",
    ):
        well_known_url = f"https://{okta_domain}/.well-known/openid-configuration" if auth_server_id is None \
            else f"https://{okta_domain}/oauth2/{auth_server_id}/.well-known/openid-configuration"
        super().__init__(
            client_id,
            client_secret,
            well_known_url,
            name=name,
            base_scopes=scopes,
        )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant