Class ScopeAuthorization
- All Implemented Interfaces:
MutinyDelegate,AuthorizationProvider
The OAuth spec allows the authorization server or user to modify the scopes granted to the application compared to what is requested, although there are not many examples of services doing this in practice.
OAuth2 does not define any particular values for scopes, since it is highly dependent on the service's internal architecture and needs.
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Paulo Lopes.
- See Also:
-
ScopeAuthorization
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vertx.mutiny.ext.auth.authorization.AuthorizationProvider
AuthorizationProvider.AuthorizationProviderImpl -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionScopeAuthorization(io.vertx.ext.auth.oauth2.authorization.ScopeAuthorization delegate) Create a new instance ofScopeAuthorizationdelegating to the given (non-null) instance ofScopeAuthorization.ScopeAuthorization(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionclaimKey()Returns the configured claim key.static ScopeAuthorizationcreate()Factory method to create a Authorization provider for Oauth 2.0 scopes using the default separator" ".static ScopeAuthorizationFactory method to create a Authorization provider for Oauth 2.0 scopes.static ScopeAuthorizationFactory method to create a Authorization provider for OpenID Connect scopes.Returns a String with the given scopes concatenated with the given separator.booleanio.smallrye.mutiny.Uni<Void>getAuthorizations(User user) Updates the user with the set of authorizations.voidUpdates the user with the set of authorizations.Updates the user with the set of authorizations.io.vertx.ext.auth.oauth2.authorization.ScopeAuthorizationGet the delegate instance.getId()returns the id of the authorization providerinthashCode()static ScopeAuthorizationnewInstance(io.vertx.ext.auth.oauth2.authorization.ScopeAuthorization delegate) Creates a new instance of theScopeAuthorization.Returns the configured separator.toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
ScopeAuthorization
public ScopeAuthorization(io.vertx.ext.auth.oauth2.authorization.ScopeAuthorization delegate) Create a new instance ofScopeAuthorizationdelegating to the given (non-null) instance ofScopeAuthorization. -
ScopeAuthorization
-
-
Method Details
-
getDelegate
public io.vertx.ext.auth.oauth2.authorization.ScopeAuthorization getDelegate()Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceAuthorizationProvider- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate instance
-
getAuthorizations
Updates the user with the set of authorizations.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Specified by:
getAuthorizationsin interfaceAuthorizationProvider- Parameters:
user- user to lookup and update.- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
io.vertx.ext.auth.oauth2.authorization.ScopeAuthorization#getAuthorizations(User)
-
getAuthorizationsAndAwait
Updates the user with the set of authorizations.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
user- user to lookup and update.- See Also:
-
io.vertx.ext.auth.oauth2.authorization.ScopeAuthorization#getAuthorizations(User)
-
getAuthorizationsAndForget
Updates the user with the set of authorizations.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
user- user to lookup and update.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
io.vertx.ext.auth.oauth2.authorization.ScopeAuthorization#getAuthorizations(User)
-
create
Factory method to create a Authorization provider for Oauth 2.0 scopes using the default separator" ".- Returns:
- a AuthorizationProvider
-
create
Factory method to create a Authorization provider for Oauth 2.0 scopes.- Parameters:
scopeSeparator- the scope separator e.g.:" ",",","+"- Returns:
- a AuthorizationProvider
-
create
Factory method to create a Authorization provider for OpenID Connect scopes. The claim key will be used to locate the scopes from a decoded JWT.- Parameters:
scopeSeparator- the scope separator e.g.:" ",",","+"claimKey- the scope claim key e.g.:"scp","scope"- Returns:
- a AuthorizationProvider
-
separator
Returns the configured separator.- Returns:
- the separator.
-
claimKey
Returns the configured claim key.- Returns:
- the claim key.
-
encode
Returns a String with the given scopes concatenated with the given separator.- Parameters:
scopes- a list of scopes- Returns:
- concatenated string.
-
getId
returns the id of the authorization provider- Specified by:
getIdin interfaceAuthorizationProvider- Returns:
-
newInstance
public static ScopeAuthorization newInstance(io.vertx.ext.auth.oauth2.authorization.ScopeAuthorization delegate) Creates a new instance of theScopeAuthorization. -
hashCode
public int hashCode() -
equals
-
toString
-