Skip to content

Use OIDC well-known configuration #672

@randomir

Description

@randomir

With OIDC .well-known now available on Leap, we should simplify/generalize some auth URL resolvers:

# note: in the future we might want to replace these url resolvers with a
# OpenID Provider Metadata server query
@staticmethod
def _infer_auth_endpoint(leap_api_endpoint: str) -> str:
return urljoin(leap_api_endpoint, '/leap/openid/authorize')
@staticmethod
def _infer_token_endpoint(leap_api_endpoint: str) -> str:
return urljoin(leap_api_endpoint, '/leap/openid/token')
@staticmethod
def _infer_revocation_endpoint(leap_api_endpoint: str) -> str:
return urljoin(leap_api_endpoint, '/leap/openid/revoke_token/')
@staticmethod
def _infer_leap_success_uri(leap_api_endpoint: str) -> str:
return urljoin(leap_api_endpoint, '/leap/openid/success/')
@staticmethod
def _infer_leap_error_uri(leap_api_endpoint: str) -> str:
return urljoin(leap_api_endpoint, '/leap/openid/error/')

Note: consider caching the configuration and/or individual auth URLs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions