Skip to content

Commit

Permalink
add endsession
Browse files Browse the repository at this point in the history
  • Loading branch information
zcemycl committed Nov 19, 2023
1 parent 4c4bd14 commit a425e6c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/example_package/auth/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
URL_JWKS = "http://localhost:8002/default_issuer/jwks"
URL_USERINFO = "http://localhost:8002/default_issuer/userinfo"
URL_REVOKE = "http://localhost:8002/default_issuer/revoke"
URL_END = "http://localhost:8002/default_issuer/.well-known/endsession"


def get_well_known_endpoint(url: str = URL_CONF):
Expand Down Expand Up @@ -71,6 +72,13 @@ def revoke_token(
print(resp.text)


# https://www.npmjs.com/package/oauth2-mock-server?activeTab=readme
def end_session(url: str = URL_END):
resp = requests.get(url)
print(resp)
print(resp.text)


if __name__ == "__main__":
print(get_well_known_endpoint())
token_resp_user = get_token(
Expand Down Expand Up @@ -103,3 +111,5 @@ def revoke_token(
print("------- jwks -------\n")
print(get_jwks())
revoke_token(new_token_resp_user["refresh_token"])

end_session()

0 comments on commit a425e6c

Please sign in to comment.