Skip to content

Commit

Permalink
Fix Auth0-client-credentials generation
Browse files Browse the repository at this point in the history
Why can't auth0 just have an alias for custom domains?
  • Loading branch information
henrikhorluck committed Feb 29, 2024
1 parent 30dd764 commit 4535488
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/authentication/auth0.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@


def auth0_client():
issuer = settings.AUTH0_ISSUER
issuer: str = settings.AUTH0_ISSUER

get_token = GetToken(
issuer,
issuer.removeprefix("https://"),
settings.AUTH0_CLIENT_ID,
client_secret=settings.AUTH0_CLIENT_SECRET,
)
token = get_token.client_credentials(f"{issuer}/api/v2/")
token = get_token.client_credentials(f"{settings.AUTH0_MGMT_TENANT}/api/v2/")
mgmt_api_token = token["access_token"]

return Auth0(issuer, mgmt_api_token)
return Auth0(issuer.removeprefix("https://"), mgmt_api_token)
1 change: 1 addition & 0 deletions onlineweb4/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def get_stats_file() -> str:
VIMEO_API_TOKEN = config("OW4_VIMEO_API_TOKEN", default=None)

AUTH0_ISSUER = config("AUTH0_ISSUER", default="")
AUTH0_MGMT_TENANT = config("AUTH0_MGMT_TENANT", default="")
AUTH0_CLIENT_ID = config("AUTH0_CLIENT_ID", default="")
AUTH0_CLIENT_SECRET = config("AUTH0_CLIENT_SECRET", default="")

Expand Down

0 comments on commit 4535488

Please sign in to comment.