-
Notifications
You must be signed in to change notification settings - Fork 0
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
adding changes for the grant type client credentials mechanism #1
base: develop
Are you sure you want to change the base?
Conversation
@@ -941,6 +960,13 @@ PAGINATION_INDEX_PLACEHOLDER, getPaginationType()), | |||
} | |||
} | |||
|
|||
private boolean refreshTokenGrantType() { | |||
if (getGrantType() == "refresh_token") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create an enum for grant types and change the above code also accordingly. and write grant type specific if conditions. e.g.(if grant == enum.refreshtoken) else if grant=client_credentials
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enum for grant type created and made changes to the conditions accordingly.
throws IOException { | ||
URI uri; | ||
try { | ||
uri = new URIBuilder(tokenUrl).setParameter("grant_type", grantType).build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
define constants where ever any keyword getting used multiple times or has scope of getting used in future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constants are defined for both client credentials method and refresh token method.
widgets/HTTP-batchsource.json
Outdated
"name": "tokenUrl", | ||
"type": "property" | ||
"widget-type": "textbox", | ||
"label": "Token URL", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
label is not required here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed the labels attribute according to the filters conditions.
…ly and also added variables for parameters values.
@@ -961,8 +965,10 @@ PAGINATION_INDEX_PLACEHOLDER, getPaginationType()), | |||
} | |||
|
|||
private boolean refreshTokenGrantType() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this method, I can directly check for the condition where ever we are using this. In case we will add multiple grant types in future, it will create issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checking the condition directly now.
@@ -0,0 +1,59 @@ | |||
/* | |||
* Copyright © 2022 Cask Data, Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made the year to 2023
…on for refresh token directly
…elop-HTTP-grantType
Added the grant type selection dropdown to select the OAuth grant type mechanism and based on that calling the function to generate the access token.