Skip to content

Commit

Permalink
Merge pull request #62 from ctriant/client-credentials-pkce
Browse files Browse the repository at this point in the history
Ignore PKCE for client credentials grant
  • Loading branch information
rohe authored May 4, 2023
2 parents 2aba2aa + 24ca0a4 commit ca7e310
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/idpyoidc/server/oauth2/token_helper/client_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
from typing import Union

from idpyoidc.message import Message
from idpyoidc.message.oauth2 import CCAccessTokenRequest
from idpyoidc.time_util import utc_time_sans_frac
from idpyoidc.util import sanitize
from . import TokenEndpointHelper

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -74,4 +76,6 @@ def post_parse_request(
client_id: Optional[str] = "",
**kwargs
):
request = CCAccessTokenRequest(**request.to_dict())
logger.debug("%s: %s" % (request.__class__.__name__, sanitize(request)))
return request
3 changes: 2 additions & 1 deletion src/idpyoidc/server/oidc/add_on/pkce.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from idpyoidc.message.oauth2 import AuthorizationErrorResponse
from idpyoidc.message.oauth2 import RefreshAccessTokenRequest
from idpyoidc.message.oauth2 import TokenExchangeRequest
from idpyoidc.message.oauth2 import CCAccessTokenRequest
from idpyoidc.message.oidc import TokenErrorResponse
from idpyoidc.server.endpoint import Endpoint

Expand Down Expand Up @@ -93,7 +94,7 @@ def post_token_parse(request, client_id, context, **kwargs):
"""
if isinstance(
request,
(AuthorizationErrorResponse, RefreshAccessTokenRequest, TokenExchangeRequest),
(AuthorizationErrorResponse, RefreshAccessTokenRequest, TokenExchangeRequest, CCAccessTokenRequest),
):
return request

Expand Down

0 comments on commit ca7e310

Please sign in to comment.