/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions Copyrighted [year] [name of copyright owner]".
*
* Copyright 2014-2015 ForgeRock AS.
* Portions Copyrighted 2015 Nomura Research Institute, Ltd.
*/
/**
* Builds a OAuth2 Client.
*
* @since 11.0.0
*/
public class ClientBuilder {
/**
* Sets the client id of the OAuth2Client.
*
* @param clientID The client id.
*/
return this;
}
/**
* Sets the client type of the OAuth2Client.
*
* @param clientType The client type.
*/
this.clientType = clientType;
return this;
}
/**
* Sets the redirection uris of the OAuth2Client.
*
* @param redirectionURIs The redirection uris.
*/
this.redirectionURIs = redirectionURIs;
return this;
}
/**
* Sets the allowed scopes of the OAuth2Client.
*
* @param allowedGrantScopes The allowed scopes.
*/
this.allowedGrantScopes = allowedGrantScopes;
return this;
}
/**
* Sets the default scopes of the OAuth2Client.
*
* @param defaultGrantScopes The default scopes.
*/
this.defaultGrantScopes = defaultGrantScopes;
return this;
}
/**
* Sets the display name of the OAuth2Client.
*
* @param displayName The display name.
*/
this.displayName = displayName;
return this;
}
/**
* Sets the client description of the OAuth2Client.
*
* @param displayDescription The client description.
*/
this.displayDescription = displayDescription;
return this;
}
/**
* Sets the client_name of the OAuth2Client
*
* @param clientName
* the client_name to set.
*/
this.clientName = clientName;
return this;
}
/**
* Sets the subject type of the OAuth2Client.
*
* @param subjectType The subject type.
*/
this.subjectType = subjectType;
return this;
}
/**
* Sets the id token signed response alg of the OAuth2Client.
*
* @param idTokenSignedResponseAlgorithm The id token signed response alg.
*/
return this;
}
/**
* Sets the post logout redirection URIs of the OAuth2Client.
*
* @param postLogoutRedirectionURIs The post logout redirection URIs.
*/
return this;
}
/**
* Sets the registration access token of the OAuth2Client.
*
* @param accessToken The registration access token.
*/
this.accessToken = accessToken;
return this;
}
/**
* Sets the client session uri of the OAuth2Client.
*
* @param clientSessionURI The client session uri.
*/
this.clientSessionURI = clientSessionURI;
return this;
}
/**
*
* @param contacts The contact information for the clients
* @return
*/
return this;
}
/**
* Sets the application type of the OAuth2Client.
*
* @param applicationType The application type.
*/
this.applicationType = applicationType;
return this;
}
/**
* Sets the client secret of the OAuth2Client.
*
* @param clientSecret The client's secret.
*/
this.clientSecret = clientSecret;
return this;
}
/**
* Sets the response types of the OAuth2Client.
*
* @param responseTypes The response types.
*/
this.responseTypes = responseTypes;
return this;
}
/**
* Sets the default max age on the OAuth2Client.
*
* @param defaultMaxAge The default max age, in seconds.
*/
this.defaultMaxAge = defaultMaxAge;
return this;
}
/**
* Sets whether to enforce the default max age.
*
* @param defaultMaxAgeEnabled Whether to enforce the default max age.
*/
return this;
}
/**
* Sets the token endpoint auth method value.
*
* @param tokenEndpointAuthMethod token endpoint auth method this client uses.
*/
return this;
}
/**
* Sets the JWKs value.
*
* @param jwks jwks containing valid public keys.
*/
return this;
}
/**
* Sets the JWKs URI value.
*
* @param jwksUri URL containing JWKs of valid public keys.
*/
return this;
}
/**
* Sets the X509 value.
*
* @param x509 Public key certificate.
*/
return this;
}
/**
* Sets the public key selector.
*
* @param selector Which of the public key types to use.
*/
return this;
}
/**
* Sets the sector identifier uri.
*
* @param sectorIdentifierUri identifier uri to be used when pairwise.
*/
return this;
}
/**
* Sets the authorization code lifetime.
*
* @param authorizationCodeLifeTime Authorization code lifetime.
*/
return this;
}
/**
* Sets the Access token lifetime.
*
* @param accessTokenLifeTime Access token lifetime.
*/
return this;
}
/**
* Sets the Refresh token lifetime.
*
* @param refreshTokenLifeTime Refresh token lifetime.
*/
return this;
}
/**
* Sets the JWT token lifetime.
*
* @param jwtTokenLifeTime JWT token lifetime.
*/
this.jwtTokenLifeTime = jwtTokenLifeTime;
return this;
}
/**
* Creates the OAuth2 Client.
*
* @return The OAuth2 Client.
*/
return new Client(clientID, clientType, redirectionURIs, allowedGrantScopes, defaultGrantScopes, displayName,
displayDescription, clientName, subjectType, idTokenSignedResponseAlgorithm, postLogoutRedirectionURIs,
accessToken, clientSessionURI, applicationType, clientSecret, responseTypes, contacts, defaultMaxAge,
}
}