Skip to content

Commit

Permalink
feat(integration): cilogon
Browse files Browse the repository at this point in the history
Integration of CILogon, which is an academic OIDC service for the US research and education community.
  • Loading branch information
caniko committed Jul 5, 2024
1 parent f6a1a8c commit e213a66
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions httpx_oauth/clients/cilogon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from typing import List, Optional, Final

from httpx_oauth.clients.openid import OpenID


BASE_SCOPES: Final = ["openid", "email"]
AVAILABLE_SCOPES: Final = ["openid", "email", "profile", "org.cilogon.userinfo"]

CILOGON_DOMAIN: Final = "cilogon.org"


class CILogonOAuth2(OpenID):
"""
Academic OIDC service for the US research and education community.
See https://www.cilogon.org/oidc for more information.
"""
def __init__(
self,
client_id: str,
client_secret: str,
scopes: Optional[List[str]] = BASE_SCOPES,
name: str = "okta",
):
super().__init__(
client_id,
client_secret,
f"https://{CILOGON_DOMAIN}/.well-known/openid-configuration",
name=name,
base_scopes=scopes,
)

0 comments on commit e213a66

Please sign in to comment.