Skip to content
Snippets Groups Projects
Commit 10508595 authored by Mohammad Torkashvand's avatar Mohammad Torkashvand
Browse files

skip calling oidc userinfo when token is client-credential flow

parent ebb73d37
No related branches found
No related tags found
1 merge request!224skip calling oidc userinfo when token is client-credential flow
Pipeline #87354 failed
......@@ -239,11 +239,16 @@ class OIDCUser(HTTPBearer):
logger.info("User is not active", url=request.url, user_info=intercepted_token)
raise HTTPException(status_code=HTTPStatus.UNAUTHORIZED, detail="User is not active")
user_info = await self.userinfo(async_request, token)
user_info["client_id"] = intercepted_token.get("client_id")
client_id = intercepted_token.get("client_id")
if "sub" not in intercepted_token:
return OIDCUserModel(
client_id=client_id
)
user_info = await self.userinfo(async_request, token)
user_info["client_id"] = client_id
logger.debug("OIDCUserModel object.", intercepted_token=intercepted_token)
return user_info
async def check_openid_config(self, async_request: AsyncClient) -> None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment