Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added code verifier as a parameter. #18

Merged
merged 7 commits into from
Nov 6, 2020
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions src/main/api/exchangeOAuthCodeForAccessTokenUsingPKCE.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"uri": "/oauth2/token",
"comments": [
"Exchanges an OAuth authorization code for an access token.",
"If using the Authorization Code grant, you will make a request to the Token endpoint to exchange the authorization code returned from the Authorize endpoint and a code_verifier for an access token."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was already here, but perhaps should be re-written, not sure what it means. We are using the authorization code grant, otherwise we wouldn't be using this method.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or if you want to leave that is fine - I can re-word some of this stuff later, I don't want to hold you up too long fixing my technical debt. :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Was trying to keep this in line with the other exchange method, defined in exchangeOAuthCodeForAccessToken.json but will rewrite both to make it clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, wasn't hard to change the verbiage a bit.

],
"method": "post",
"methodName": "exchangeOAuthCodeForAccessTokenUsingPKCE",
"successResponse": "AccessToken",
"errorResponse": "OAuthError",
"anonymous": true,
"params": [
{
"name": "code",
"comments": [
"The authorization code returned on the /oauth2/authorize response."
],
"type": "form",
"javaType": "String"
},
{
"name": "client_id",
"comments": [
"(Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you you are attempting to authenticate. This parameter is optional when the Authorization header is provided."
],
"type": "form",
"javaType": "String"
},
{
"name": "client_secret",
"comments": [
"(Optional) The client secret. This value may optionally be provided in the request body instead of the Authorization header."
],
"type": "form",
"javaType": "String"
},
{
"name": "grant_type",
"comments": [
"The grant type to be used. This value must be set to authorization_code"
],
"type": "form",
"javaType": "String",
"constant": true,
"value": "authorization_code"
},
{
"name": "redirect_uri",
"comments": [
"The URI to redirect to upon a successful request."
],
"type": "form",
"javaType": "String"
},
{
"name": "code_verifier",
"comments": [
"The random string generated previously. Will be compared with the code_challenge sent previously, which allows the OAuth provider to authenticate your app."
],
"type": "form",
"javaType": "String"
}
]
}