Class AuthorizationRequest.Builder

    • Constructor Detail

      • Builder

        public Builder​(ResponseType rt,
                       ClientID clientID)
        Creates a new authorisation request builder.
        Parameters:
        rt - The response type. Corresponds to the response_type parameter. Must not be null.
        clientID - The client identifier. Corresponds to the client_id parameter. Must not be null.
      • Builder

        public Builder​(com.nimbusds.jwt.JWT requestObject,
                       ClientID clientID)
        Creates a new JWT secured authorisation request (JAR) builder.
        Parameters:
        requestObject - The request object. Must not be null.'
        clientID - The client ID. Must not be null.
      • Builder

        public Builder​(URI requestURI,
                       ClientID clientID)
        Creates a new JWT secured authorisation request (JAR) builder.
        Parameters:
        requestURI - The request object URI. Must not be null.
        clientID - The client ID. Must not be null.
      • Builder

        public Builder​(AuthorizationRequest request)
        Creates a new authorisation request builder from the specified request.
        Parameters:
        request - The authorisation request. Must not be null.
    • Method Detail

      • redirectionURI

        public AuthorizationRequest.Builder redirectionURI​(URI redirectURI)
        Sets the redirection URI. Corresponds to the optional redirection_uri parameter.
        Parameters:
        redirectURI - The redirection URI, null if not specified.
        Returns:
        This builder.
      • scope

        public AuthorizationRequest.Builder scope​(Scope scope)
        Sets the scope. Corresponds to the optional scope parameter.
        Parameters:
        scope - The scope, null if not specified.
        Returns:
        This builder.
      • state

        public AuthorizationRequest.Builder state​(State state)
        Sets the state. Corresponds to the recommended state parameter.
        Parameters:
        state - The state, null if not specified.
        Returns:
        This builder.
      • responseMode

        public AuthorizationRequest.Builder responseMode​(ResponseMode rm)
        Sets the response mode. Corresponds to the optional response_mode parameter. Use of this parameter is not recommended unless a non-default response mode is requested (e.g. form_post).
        Parameters:
        rm - The response mode, null if not specified.
        Returns:
        This builder.
      • codeChallenge

        @Deprecated
        public AuthorizationRequest.Builder codeChallenge​(CodeChallenge codeChallenge,
                                                          CodeChallengeMethod codeChallengeMethod)
        Deprecated.
        Sets the code challenge for Proof Key for Code Exchange (PKCE) by public OAuth clients.
        Parameters:
        codeChallenge - The code challenge, null if not specified.
        codeChallengeMethod - The code challenge method, null if not specified.
        Returns:
        This builder.
      • codeChallenge

        public AuthorizationRequest.Builder codeChallenge​(CodeVerifier codeVerifier,
                                                          CodeChallengeMethod codeChallengeMethod)
        Sets the code challenge for Proof Key for Code Exchange (PKCE) by public OAuth clients.
        Parameters:
        codeVerifier - The code verifier to use to compute the code challenge, null if PKCE is not specified.
        codeChallengeMethod - The code challenge method, null if not specified. Defaults to CodeChallengeMethod.PLAIN if a code verifier is specified.
        Returns:
        This builder.
      • resources

        public AuthorizationRequest.Builder resources​(URI... resources)
        Sets the resource server URI(s).
        Parameters:
        resources - The resource URI(s), null if not specified.
        Returns:
        This builder.
      • includeGrantedScopes

        public AuthorizationRequest.Builder includeGrantedScopes​(boolean includeGrantedScopes)
        Requests incremental authorisation.
        Parameters:
        includeGrantedScopes - true to request incremental authorisation.
        Returns:
        This builder.
      • requestObject

        public AuthorizationRequest.Builder requestObject​(com.nimbusds.jwt.JWT requestObject)
        Sets the request object. Corresponds to the optional request parameter. Must not be specified together with a request object URI.
        Parameters:
        requestObject - The request object, null if not specified.
        Returns:
        This builder.
      • requestURI

        public AuthorizationRequest.Builder requestURI​(URI requestURI)
        Sets the request object URI. Corresponds to the optional request_uri parameter. Must not be specified together with a request object.
        Parameters:
        requestURI - The request object URI, null if not specified.
        Returns:
        This builder.
      • prompt

        public AuthorizationRequest.Builder prompt​(Prompt prompt)
        Sets the requested prompt. Corresponds to the optional prompt parameter.
        Parameters:
        prompt - The requested prompt, null if not specified.
        Returns:
        This builder.
      • endpointURI

        public AuthorizationRequest.Builder endpointURI​(URI uri)
        Sets the URI of the endpoint (HTTP or HTTPS) for which the request is intended.
        Parameters:
        uri - The endpoint URI, null if not specified.
        Returns:
        This builder.