-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#195 fix token-exchange endpoint request parameter should be in reque…
…stBody x-www-form-urlencoded
- Loading branch information
Showing
6 changed files
with
97 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
sts-token/src/main/java/de/adorsys/sts/token/api/TokenRequestForm.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package de.adorsys.sts.token.api; | ||
|
||
import de.adorsys.sts.token.tokenexchange.TokenExchangeConstants; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
import java.beans.ConstructorProperties; | ||
|
||
@Getter | ||
@AllArgsConstructor(onConstructor_ = @ConstructorProperties({"grant_type", "resource", "audience", "scope", "requested_token_type", "subject_token", "subject_token_type", "actor_token", "actor_token_type"})) | ||
@Schema(description = "Carries request form properties of a token-exchange request", | ||
requiredProperties = {"grant_type", "subject_token", "subject_token_type"}) | ||
public class TokenRequestForm { | ||
|
||
@Schema(name = "grant_type", | ||
description = "Indicates that a token exchange is being performed.", | ||
example = TokenExchangeConstants.TOKEN_EXCHANGE_OAUTH_GRANT_TYPE) | ||
private String grantType; | ||
|
||
@Schema(name = "resource", | ||
description = "Indicates the physical location of the target service or resource where the client intends to use the requested security token. This enables the authorization server to apply policy as appropriate for the target, such as determining the type and content of the token to be issued or if and how the token is to be encrypted.", | ||
example = "http://localhost:8080/multibanking-service") | ||
private String[] resources; | ||
|
||
@Schema(name = "audience", | ||
description = "The logical name of the target service where the client intends to use the requested security token. This serves a purpose similar to the resource parameter, but with the client providing a logical name rather than a physical location.", | ||
example = "http://localhost:8080/multibanking-service") | ||
private String[] audiences; | ||
|
||
@Schema(name = "scope", | ||
description = "A list of space-delimited, case-sensitive strings that allow the client to specify the desired scope of the requested security token in the context of the service or resource where the token will be used.", | ||
example = "user banking") | ||
private String scope; | ||
|
||
@Schema(name = "requested_token_type", | ||
description = "An identifier for the type of the requested security token. If the requested type is unspecified, the issued token type is at the discretion of the authorization server and may be dictated by knowledge of the requirements of the service or resource indicated by the resource or audience parameter. This can be urn:ietf:params:oauth:token-type:jwt or urn:ietf:params:oauth:token-type:saml.", | ||
example = TokenExchangeConstants.JWT_OAUTH_TOKEN_TYPE) | ||
private String requestedTokenType; | ||
|
||
@Schema(name = "subject_token", | ||
description = "A security token that represents the identity of the party on behalf of whom the request is being made. Typically, the subject of this token will be the subject of the security token issued in response to this request.", | ||
example = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJNYXhNdXN0ZXJtYW4iLCJyb2xlIjoiVVNFUiIsImV4cCI6MTQ5NTM5MTAxM30.mN9eFMnEuYgh_KCULI8Gpm1X49wWaA67Ps1M7EFV0BQ") | ||
private String subjectToken; | ||
|
||
@Schema(name = "subject_token_type", | ||
description = "An identifier for the type of the requested security token. If the requested type is unspecified, the issued token type is at the discretion of the authorization server and may be dictated by knowledge of the requirements of the service or resource indicated by the resource or audience parameter. This can be urn:ietf:params:oauth:token-type:jwt or urn:ietf:params:oauth:token-type:saml. This can be urn:ietf:params:oauth:token-type:access_token or urn:ietf:params:oauth:token-type:refresh_token.", | ||
example = TokenExchangeConstants.JWT_OAUTH_TOKEN_TYPE) | ||
private String subjectTokenType; | ||
|
||
@Schema(name = "actor_token", | ||
description = "A security token that represents the identity of the acting party. Typically this will be the party that is authorized to use the requested security token and act on behalf of the subject.", | ||
example = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJNYXhNdXN0ZXJtYW4iLCJyb2xlIjoiVVNFUiIsImV4cCI6MTQ5NTM5MTAxM30.mN9eFMnEuYgh_KCULI8Gpm1X49wWaA67Ps1M7EFV0BQ") | ||
private String actorToken; | ||
|
||
@Schema(name = "actor_token_type", | ||
description = "An identifier for the type of the requested security token. If the requested type is unspecified, the issued token type is at the discretion of the authorization server and may be dictated by knowledge of the requirements of the service or resource indicated by the resource or audience parameter. This can be urn:ietf:params:oauth:token-type:jwt or urn:ietf:params:oauth:token-type:saml. This can be urn:ietf:params:oauth:token-type:access_token or urn:ietf:params:oauth:token-type:refresh_token.", | ||
example = TokenExchangeConstants.JWT_OAUTH_TOKEN_TYPE) | ||
private String actorTokenType; | ||
} |