Package com.azure.core.credential
Class TokenRequestContext
- java.lang.Object
-
- com.azure.core.credential.TokenRequestContext
-
public class TokenRequestContext extends Object
Contains details of a request to get a token.
-
-
Constructor Summary
Constructors Constructor Description TokenRequestContext()
Creates a token request instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TokenRequestContext
addScopes(String... scopes)
Adds one or more scopes to the request scopes.String
getClaims()
Get the additional claims to be included in the token.List<String>
getScopes()
Gets the scopes required for the token.String
getTenantId()
Get the tenant id to be used for the authentication request.TokenRequestContext
setClaims(String claims)
Set the additional claims to be included in the token.TokenRequestContext
setScopes(List<String> scopes)
Sets the scopes required for the token.TokenRequestContext
setTenantId(String tenantId)
Set the tenant id to be used for the authentication request.
-
-
-
Method Detail
-
getScopes
public List<String> getScopes()
Gets the scopes required for the token.- Returns:
- the scopes required for the token
-
setScopes
public TokenRequestContext setScopes(List<String> scopes)
Sets the scopes required for the token.- Parameters:
scopes
- the scopes required for the token- Returns:
- the TokenRequestContext itself
-
addScopes
public TokenRequestContext addScopes(String... scopes)
Adds one or more scopes to the request scopes.- Parameters:
scopes
- one or more scopes to add- Returns:
- the TokenRequestContext itself
-
setClaims
public TokenRequestContext setClaims(String claims)
Set the additional claims to be included in the token.- Parameters:
claims
- the additional claims to be included in the token.- Returns:
- the updated TokenRequestContext itself
- See Also:
- https://openid.net/specs/openid-connect-core-1_0-final.html#ClaimsParameter
-
getClaims
public String getClaims()
Get the additional claims to be included in the token.- Returns:
- the additional claims to be included in the token.
- See Also:
- https://openid.net/specs/openid-connect-core-1_0-final.html#ClaimsParameter
-
setTenantId
public TokenRequestContext setTenantId(String tenantId)
Set the tenant id to be used for the authentication request.- Parameters:
tenantId
- the tenant to be used when requesting the token.- Returns:
- the updated TokenRequestContext itself
-
getTenantId
public String getTenantId()
Get the tenant id to be used for the authentication request.- Returns:
- the configured tenant id.
-
-