public class ScpCfPrincipalFacade extends DefaultPrincipalFacade
Principal
information on SAP Cloud Platform Cloud Foundry.Constructor and Description |
---|
ScpCfPrincipalFacade()
Default constructor with default strategies.
|
ScpCfPrincipalFacade(LocalScopePrefixProvider localScopePrefixProvider)
Creates a new instance of this facade with the given prefix provider.
|
Modifier and Type | Method and Description |
---|---|
void |
setIdExtractorFunction(String grantType,
io.vavr.CheckedFunction1<com.auth0.jwt.interfaces.DecodedJWT,String> principalIdExtractor)
This allows to set/override the way the
Principal.getPrincipalId() is obtained, given a
grant_type in the AuthToken . |
io.vavr.control.Try<Principal> |
tryGetCurrentPrincipal()
Returns a
Try of the current Principal . |
public ScpCfPrincipalFacade(@Nullable LocalScopePrefixProvider localScopePrefixProvider)
localScopePrefixProvider
- The prefix provider to be used to remove prefixes from authorizations.public ScpCfPrincipalFacade()
public void setIdExtractorFunction(@Nonnull String grantType, @Nonnull io.vavr.CheckedFunction1<com.auth0.jwt.interfaces.DecodedJWT,String> principalIdExtractor)
Principal.getPrincipalId()
is obtained, given a
grant_type
in the AuthToken
.grantType
- The grant type to use the extractor for.principalIdExtractor
- The logic to obtain an id for the Principal
from the AuthToken
.@Nonnull public io.vavr.control.Try<Principal> tryGetCurrentPrincipal()
DefaultPrincipalFacade
Try
of the current Principal
.tryGetCurrentPrincipal
in interface PrincipalFacade
tryGetCurrentPrincipal
in class DefaultPrincipalFacade
Try
of the current Principal
.Copyright © 2019 SAP SE. All rights reserved.