Class OAuthUtils
java.lang.Object
org.apache.cxf.rs.security.oauth2.utils.OAuthUtils
Various utility methods
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckRequestURI(String servletPath, String uri) static booleancompareCertificateThumbprints(X509Certificate cert, String encodedThumbprint) static booleancompareTlsCertificates(TLSSessionInfo tlsInfo, List<String> base64EncodedCerts) static StringconvertListOfScopesToString(List<String> registeredScopes) static Stringstatic byte[]static UserSubjectstatic UserSubjectcreateSubject(SecurityContext securityContext) static Stringstatic StringgenerateRandomTokenKey(int byteSize) static JweDecryptionProvidergetClientSecretDecryptionProvider(String clientSecret) static JweEncryptionProvidergetClientSecretEncryptionProvider(String clientSecret) static SignatureAlgorithmgetClientSecretSignatureAlgorithm(Properties sigProps) static JwsSignatureProvidergetClientSecretSignatureProvider(String clientSecret) static JwsSignatureVerifiergetClientSecretSignatureVerifier(String clientSecret) static longstatic StringgetRequestedScopes(Client client, String scopeParameter, boolean useAllClientScopes, boolean partialMatchScopeValidation) getRequestedScopes(Client client, String scopeParameter, boolean useAllClientScopes, boolean partialMatchScopeValidation, boolean defaultToRegisteredScopes) static X509CertificategetRootTLSCertificate(TLSSessionInfo tlsInfo) static Stringstatic StringgetSessionToken(MessageContext mc, String attribute) static StringgetSessionToken(MessageContext mc, String attribute, boolean remove) static Stringstatic voidinjectContextIntoOAuthProvider(MessageContext context, Object provider) static booleanstatic booleanisGrantSupportedForClient(Client client, boolean canSupportPublicClients, String grantType) static booleanisMutualTls(jakarta.ws.rs.core.SecurityContext sc, TLSSessionInfo tlsSessionInfo) parseScope(String requestedScope) static voidstatic Stringstatic StringsetSessionToken(MessageContext mc, int maxInactiveInterval) static StringsetSessionToken(MessageContext mc, String sessionToken) static StringsetSessionToken(MessageContext mc, String sessionToken, int maxInactiveInterval) static StringsetSessionToken(MessageContext mc, String sessionToken, String attribute, int maxInactiveInterval) static ClientAccessTokentoClientAccessToken(ServerAccessToken serverToken, boolean supportOptionalParams) static booleanvalidateAudience(String providedAudience, List<String> allowedAudiences) static booleanvalidateAudiences(List<String> providedAudiences, List<String> allowedAudiences) static booleanvalidateScopes(List<String> requestScopes, List<String> registeredScopes, boolean partialMatchScopeValidation)
-
Method Details
-
createCertificateThumbprint
- Throws:
Exception
-
setCertificateThumbprintConfirmation
-
compareCertificateThumbprints
-
compareTlsCertificates
public static boolean compareTlsCertificates(TLSSessionInfo tlsInfo, List<String> base64EncodedCerts) -
isMutualTls
public static boolean isMutualTls(jakarta.ws.rs.core.SecurityContext sc, TLSSessionInfo tlsSessionInfo) -
getSubjectDnFromTLSCertificates
-
getIssuerDnFromTLSCertificates
-
getRootTLSCertificate
-
injectContextIntoOAuthProvider
-
setSessionToken
-
setSessionToken
-
setSessionToken
-
setSessionToken
public static String setSessionToken(MessageContext mc, String sessionToken, int maxInactiveInterval) -
setSessionToken
public static String setSessionToken(MessageContext mc, String sessionToken, String attribute, int maxInactiveInterval) -
getSessionToken
-
getSessionToken
-
getSessionToken
-
createSubject
-
createSubject
-
convertPermissionsToScope
-
convertPermissionsToScopeList
-
isGrantSupportedForClient
-
parseScope
-
generateRandomTokenKey
- Throws:
OAuthServiceException
-
generateRandomTokenKey
-
getIssuedAt
public static long getIssuedAt() -
isExpired
-
validateAudience
-
validateAudiences
-
checkRequestURI
-
getRequestedScopes
-
getRequestedScopes
-
validateScopes
-
toClientAccessToken
public static ClientAccessToken toClientAccessToken(ServerAccessToken serverToken, boolean supportOptionalParams) -
getClientSecretSignatureProvider
-
getClientSecretSignatureVerifier
-
getClientSecretDecryptionProvider
-
getClientSecretEncryptionProvider
-
getClientSecretSignatureAlgorithm
-
convertListOfScopesToString
-