Package com.nimbusds.oauth2.sdk.client
Class ClientRegistrationRequest
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.AbstractRequest
-
- com.nimbusds.oauth2.sdk.ProtectedResourceRequest
-
- com.nimbusds.oauth2.sdk.client.ClientRegistrationRequest
-
- Direct Known Subclasses:
OIDCClientRegistrationRequest
@Immutable public class ClientRegistrationRequest extends ProtectedResourceRequest
Client registration request.Example HTTP request:
POST /register HTTP/1.1 Content-Type: application/json Accept: application/json Authorization: Bearer ey23f2.adfj230.af32-developer321 Host: server.example.com { "redirect_uris" : [ "https://client.example.org/callback", "https://client.example.org/callback2" ], "client_name" : "My Example Client", "client_name#ja-Jpan-JP" : "クライアント名", "token_endpoint_auth_method" : "client_secret_basic", "scope" : "read write dolphin", "logo_uri" : "https://client.example.org/logo.png", "jwks_uri" : "https://client.example.org/my_public_keys.jwks" }
Example HTTP request with a software statement:
POST /register HTTP/1.1 Content-Type: application/json Accept: application/json Host: server.example.com { "redirect_uris" : [ "https://client.example.org/callback", "https://client.example.org/callback2" ], "software_statement" : "eyJhbGciOiJFUzI1NiJ9.eyJpc3Mi[...omitted for brevity...]", "scope" : "read write", "example_extension_parameter" : "example_value" }
Related specifications:
- OAuth 2.0 Dynamic Client Registration Protocol (RFC 7591), sections 2 and 3.1.
-
-
Constructor Summary
Constructors Constructor Description ClientRegistrationRequest(URI uri, ClientMetadata metadata, com.nimbusds.jwt.SignedJWT softwareStatement, BearerAccessToken accessToken)
Creates a new client registration request with an optional software statement.ClientRegistrationRequest(URI uri, ClientMetadata metadata, BearerAccessToken accessToken)
Creates a new client registration request.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ClientMetadata
getClientMetadata()
Gets the associated client metadata.com.nimbusds.jwt.SignedJWT
getSoftwareStatement()
Gets the software statement.static ClientRegistrationRequest
parse(HTTPRequest httpRequest)
Parses a client registration request from the specified HTTP POST request.HTTPRequest
toHTTPRequest()
Returns the matching HTTP request.-
Methods inherited from class com.nimbusds.oauth2.sdk.ProtectedResourceRequest
getAccessToken
-
Methods inherited from class com.nimbusds.oauth2.sdk.AbstractRequest
getEndpointURI
-
-
-
-
Constructor Detail
-
ClientRegistrationRequest
public ClientRegistrationRequest(URI uri, ClientMetadata metadata, BearerAccessToken accessToken)
Creates a new client registration request.- Parameters:
uri
- The URI of the client registration endpoint. May benull
if thetoHTTPRequest()
method will not be used.metadata
- The client metadata. Must not benull
and must specify one or more redirection URIs.accessToken
- An OAuth 2.0 Bearer access token for the request,null
if none.
-
ClientRegistrationRequest
public ClientRegistrationRequest(URI uri, ClientMetadata metadata, com.nimbusds.jwt.SignedJWT softwareStatement, BearerAccessToken accessToken)
Creates a new client registration request with an optional software statement.- Parameters:
uri
- The URI of the client registration endpoint. May benull
if thetoHTTPRequest()
method will not be used.metadata
- The client metadata. Must not benull
and must specify one or more redirection URIs.softwareStatement
- Optional software statement, as a signed JWT with aniss
claim;null
if not specified.accessToken
- An OAuth 2.0 Bearer access token for the request,null
if none.
-
-
Method Detail
-
getClientMetadata
public ClientMetadata getClientMetadata()
Gets the associated client metadata.- Returns:
- The client metadata.
-
getSoftwareStatement
public com.nimbusds.jwt.SignedJWT getSoftwareStatement()
Gets the software statement.- Returns:
- The software statement, as a signed JWT with an
iss
claim;null
if not specified.
-
toHTTPRequest
public HTTPRequest toHTTPRequest()
Description copied from interface:Request
Returns the matching HTTP request.- Returns:
- The HTTP request.
-
parse
public static ClientRegistrationRequest parse(HTTPRequest httpRequest) throws ParseException
Parses a client registration request from the specified HTTP POST request.- Parameters:
httpRequest
- The HTTP request. Must not benull
.- Returns:
- The client registration request.
- Throws:
ParseException
- If the HTTP request couldn't be parsed to a client registration request.
-
-