Package net.openid.appauth
Class RegistrationResponse
- java.lang.Object
-
- net.openid.appauth.RegistrationResponse
-
public class RegistrationResponse extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRegistrationResponse.Builderstatic classRegistrationResponse.MissingArgumentExceptionThrown when a mandatory property is missing from the registration response.
-
Field Summary
Fields Modifier and Type Field Description Map<String,String>additionalParametersAdditional, non-standard parameters in the response.StringclientIdThe registered client identifier.LongclientIdIssuedAtTimestamp of when the client identifier was issued, if provided.StringclientSecretThe client secret, which is part of the client credentials, if provided.LongclientSecretExpiresAtTimestamp of when the client credentials expires, if provided.StringregistrationAccessTokenClient registration access token that can be used for subsequent operations upon the client registration.UriregistrationClientUriLocation of the client configuration endpoint, if provided.RegistrationRequestrequestThe registration request associated with this response.StringtokenEndpointAuthMethodClient authentication method to use at the token endpoint, if provided.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RegistrationResponsefromJson(RegistrationRequest request, String jsonStr)Reads a registration response JSON string received from an authorization server, and associates it with the provided request.static RegistrationResponsefromJson(RegistrationRequest request, JSONObject json)Reads a registration response JSON object received from an authorization server, and associates it with the provided request.booleanhasClientSecretExpired()Determines whether the returned access token has expired.static RegistrationResponsejsonDeserialize(String jsonStr)Reads a registration response from a JSON string representation produced byjsonSerializeString().static RegistrationResponsejsonDeserialize(JSONObject json)Reads a registration response from a JSON string representation produced byjsonSerialize().JSONObjectjsonSerialize()Produces a JSON representation of the registration response for persistent storage or local transmission (e.g.StringjsonSerializeString()Produces a JSON string representation of the registration response for persistent storage or local transmission (e.g.
-
-
-
Field Detail
-
request
@NonNull public final RegistrationRequest request
The registration request associated with this response.
-
clientId
@NonNull public final String clientId
The registered client identifier.- See Also:
“The OAuth 2.0 Authorization Framework (RFC 6749), Section 4 https://tools.ietf.org/html/rfc6749#section-4”,“The OAuth 2.0 Authorization Framework (RFC 6749), Section 4.1.1 https://tools.ietf.org/html/rfc6749#section-4.1.1”
-
clientIdIssuedAt
@Nullable public final Long clientIdIssuedAt
Timestamp of when the client identifier was issued, if provided.- See Also:
“OpenID Connect Dynamic Client Registration 1.0, Section 3.2 https://openid.net/specs/openid-connect-discovery-1_0.html#rfc.section.3.2”
-
clientSecret
@Nullable public final String clientSecret
The client secret, which is part of the client credentials, if provided.- See Also:
“OpenID Connect Dynamic Client Registration 1.0, Section 3.2 https://openid.net/specs/openid-connect-discovery-1_0.html#rfc.section.3.2”
-
clientSecretExpiresAt
@Nullable public final Long clientSecretExpiresAt
Timestamp of when the client credentials expires, if provided.- See Also:
“OpenID Connect Dynamic Client Registration 1.0, Section 3.2 https://openid.net/specs/openid-connect-discovery-1_0.html#rfc.section.3.2”
-
registrationAccessToken
@Nullable public final String registrationAccessToken
Client registration access token that can be used for subsequent operations upon the client registration.- See Also:
“OpenID Connect Dynamic Client Registration 1.0, Section 3.2 https://openid.net/specs/openid-connect-discovery-1_0.html#rfc.section.3.2”
-
registrationClientUri
@Nullable public final Uri registrationClientUri
Location of the client configuration endpoint, if provided.- See Also:
“OpenID Connect Dynamic Client Registration 1.0, Section 3.2 https://openid.net/specs/openid-connect-discovery-1_0.html#rfc.section.3.2”
-
tokenEndpointAuthMethod
@Nullable public final String tokenEndpointAuthMethod
Client authentication method to use at the token endpoint, if provided.- See Also:
“OpenID Connect Core 1.0, Section 9 https://openid.net/specs/openid-connect-core-1_0.html#rfc.section.9”
-
additionalParameters
@NonNull public final Map<String,String> additionalParameters
Additional, non-standard parameters in the response.
-
-
Method Detail
-
fromJson
@NonNull public static RegistrationResponse fromJson(@NonNull RegistrationRequest request, @NonNull String jsonStr) throws JSONException, RegistrationResponse.MissingArgumentException
Reads a registration response JSON string received from an authorization server, and associates it with the provided request.- Throws:
JSONException- if the JSON is malformed or missing required fields.RegistrationResponse.MissingArgumentException- if the JSON is missing fields required by the specification.
-
fromJson
@NonNull public static RegistrationResponse fromJson(@NonNull RegistrationRequest request, @NonNull JSONObject json) throws JSONException, RegistrationResponse.MissingArgumentException
Reads a registration response JSON object received from an authorization server, and associates it with the provided request.- Throws:
JSONException- if the JSON is malformed or missing required fields.RegistrationResponse.MissingArgumentException- if the JSON is missing fields required by the specification.
-
jsonSerialize
@NonNull public JSONObject jsonSerialize()
Produces a JSON representation of the registration response for persistent storage or local transmission (e.g.between activities).
-
jsonSerializeString
@NonNull public String jsonSerializeString()
Produces a JSON string representation of the registration response for persistent storage or local transmission (e.g.between activities). This method is just a convenience wrapper for
jsonSerialize(), converting the JSON object to its string form.
-
jsonDeserialize
public static RegistrationResponse jsonDeserialize(@NonNull JSONObject json) throws JSONException
Reads a registration response from a JSON string representation produced byjsonSerialize().- Throws:
JSONException- if the provided JSON does not match the expected structure.
-
jsonDeserialize
@NonNull public static RegistrationResponse jsonDeserialize(@NonNull String jsonStr) throws JSONException
Reads a registration response from a JSON string representation produced byjsonSerializeString().This method is just a convenience wrapper for
jsonDeserialize(JSONObject), converting the JSON string to its JSON object form.- Throws:
JSONException- if the provided JSON does not match the expected structure.
-
hasClientSecretExpired
public boolean hasClientSecretExpired()
Determines whether the returned access token has expired.
-
-