Class ConsentPageModelMapper
java.lang.Object
com.irurueta.authserver.authorization.api.web.consent.ConsentPageModelMapper
Builds the
ConsentPageModel from the registered client, the requested scopes and the scopes granted
earlier. Scope descriptions come from messages.properties (consent.scope.<name>); a scope without
a description is shown by its name.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.springframework.context.MessageSourceResolves the scope descriptions.(package private) static final StringPrefix of the message code of a scope description. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiontoModel(org.springframework.security.oauth2.server.authorization.client.RegisteredClient client, String principalName, String state, String requestedScopes, Collection<String> grantedScopes, Locale locale) Maps the consent request to its view model.private ConsentPageModel.ScopeViewDescribes a scope.
-
Field Details
-
SCOPE_MESSAGE_PREFIX
Prefix of the message code of a scope description.- See Also:
-
messageSource
private final org.springframework.context.MessageSource messageSourceResolves the scope descriptions.
-
-
Constructor Details
-
ConsentPageModelMapper
public ConsentPageModelMapper()
-
-
Method Details
-
toModel
public ConsentPageModel toModel(org.springframework.security.oauth2.server.authorization.client.RegisteredClient client, String principalName, String state, String requestedScopes, Collection<String> grantedScopes, Locale locale) Maps the consent request to its view model. Theopenidscope is never listed: it only asks for the identity the user has just proved by signing in. Scopes granted earlier are listed apart.- Parameters:
client- client that asks for access.principalName- name of the signed-in user.state- state of the authorization request.requestedScopes- requested scopes, space delimited as in the authorization request.grantedScopes- scopes the user granted to the client earlier.locale- locale of the descriptions.- Returns:
- the view model.
-
view
Describes a scope.- Parameters:
scope- name of the scope.locale- locale of the description.- Returns:
- the scope with its description.
-