adding changes for the grant type client credentials mechanism#1
adding changes for the grant type client credentials mechanism#1
Conversation
| } | ||
|
|
||
| private boolean refreshTokenGrantType() { | ||
| if (getGrantType() == "refresh_token") { |
There was a problem hiding this comment.
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.
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.
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.
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.
label is not required here.
There was a problem hiding this comment.
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.
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.
checking the condition directly now.
| @@ -0,0 +1,59 @@ | |||
| /* | |||
| * Copyright © 2022 Cask Data, Inc. | |||
…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.