Class AuthorizationCodeUriRequest.Builder
java.lang.Object
se.michaelthelin.spotify.requests.AbstractRequest.Builder<URI,AuthorizationCodeUriRequest.Builder>
se.michaelthelin.spotify.requests.authorization.authorization_code.AuthorizationCodeUriRequest.Builder
- All Implemented Interfaces:
IRequest.Builder<URI,
AuthorizationCodeUriRequest.Builder>
- Enclosing class:
AuthorizationCodeUriRequest
public static final class AuthorizationCodeUriRequest.Builder
extends AbstractRequest.Builder<URI,AuthorizationCodeUriRequest.Builder>
Builder class for building an
AuthorizationCodeUriRequest
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
The request build method.The client ID setter.code_challenge
(String code_challenge) The code challenge setter.code_challenge_method
(String code_challenge_method) The code challenge method setter.redirect_uri
(URI redirect_uri) The redirect URI setter.response_type
(String response_type) The response type setter.The scope setter.scope
(AuthorizationScope... scopes) protected AuthorizationCodeUriRequest.Builder
self()
Return this instance to simulate a self-type.show_dialog
(boolean show_dialog) The show dialog setter.The state setter.Methods inherited from class se.michaelthelin.spotify.requests.AbstractRequest.Builder
setBody, setBodyParameter, setContentType, setDefaults, setHeader, setHost, setHttpManager, setPath, setPathParameter, setPort, setQueryParameter, setScheme
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
client_id
The client ID setter.- Parameters:
client_id
- Required. The client ID provided to you by Spotify when you register your application.- Returns:
- An
AuthorizationCodeUriRequest.Builder
.
-
response_type
The response type setter.- Parameters:
response_type
- Required. Set it to"code"
.- Returns:
- An
AuthorizationCodeUriRequest.Builder
.
-
redirect_uri
The redirect URI setter.- Parameters:
redirect_uri
- Required. The URI to redirect to after the user grants/denies permission. This URI needs to have been entered in the Redirect URI whitelist that you specified when you registered your application. The value ofredirect_uri
here must exactly match one of the values you entered when you registered your application, including upper/lowercase, terminating slashes, etc.- Returns:
- An
AuthorizationCodeUriRequest.Builder
.
-
code_challenge_method
The code challenge method setter.- Parameters:
code_challenge_method
- Required if the Proof Key for Code Exchange (PKCE) flow is used. Set it to"S256"
.- Returns:
- An
AuthorizationCodeUriRequest.Builder
.
-
code_challenge
The code challenge setter.- Parameters:
code_challenge
- Required if the Proof Key for Code Exchange (PKCE) flow is used. The code challenge that your app calculated beforehand. The code challenge is the base64url encoded sha256-hash of the code verifier, which is a cryptographically random string between 43 and 128 characters in length. It can contain letters, digits, underscores, periods, hyphens, or tildes and is generated by your app before each authentication request.- Returns:
- An
AuthorizationCodeUriRequest.Builder
. - See Also:
-
state
The state setter.- Parameters:
state
- Optional, but strongly recommended. The state can be useful for correlating requests and responses. Because yourredirect_uri
can be guessed, using a state value can increase your assurance that an incoming connection is the result of an authentication request. If you generate a random string or encode the hash of some client state (e.g., a cookie) in this state variable, you can validate the response to additionally ensure that the request and response originated in the same browser. This provides protection against attacks such as cross-site request forgery.- Returns:
- An
AuthorizationCodeUriRequest.Builder
. - See Also:
-
scope
The scope setter.- Parameters:
scope
- Optional. A space-separated list of scopes. If no scopes are specified, authorization will be granted only to access publicly available information: that is, only information normally visible in the Spotify desktop, web and mobile players.- Returns:
- An
AuthorizationCodeUriRequest.Builder
. - See Also:
-
scope
-
show_dialog
The show dialog setter.- Parameters:
show_dialog
- Optional. Whether or not to force the user to approve the app again if they’ve already done so. Iffalse
(default), a user who has already approved the application may be automatically redirected to the URI specified byredirect_uri
. Iftrue
, the user will not be automatically redirected and will have to approve the app again.- Returns:
- An
AuthorizationCodeUriRequest.Builder
.
-
build
The request build method.- Returns:
- An
AuthorizationCodeUriRequest
.
-
self
Description copied from class:AbstractRequest.Builder
Return this instance to simulate a self-type.- Specified by:
self
in classAbstractRequest.Builder<URI,
AuthorizationCodeUriRequest.Builder> - Returns:
- This instance.
-