Package io.trino.server.security.oauth2
Class OAuth2Service
- java.lang.Object
-
- io.trino.server.security.oauth2.OAuth2Service
-
public class OAuth2Service extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOAuth2Service.OAuthChallengestatic classOAuth2Service.OAuthResult
-
Field Summary
Fields Modifier and Type Field Description static StringNONCEstatic StringOPENID_SCOPEstatic StringREDIRECT_URIstatic StringSTATE
-
Constructor Summary
Constructors Constructor Description OAuth2Service(OAuth2Client client, io.jsonwebtoken.SigningKeyResolver signingKeyResolver, OAuth2Config oauth2Config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OAuth2Service.OAuthResultfinishChallenge(Optional<UUID> authId, String code, URI callbackUri, Optional<String> nonce)Optional<UUID>getAuthId(String state)StringgetCallbackErrorHtml(String errorCode)StringgetInternalFailureHtml(String errorMessage)StringgetSuccessHtml()io.jsonwebtoken.Jws<io.jsonwebtoken.Claims>parseClaimsJws(String token)URIstartRestChallenge(URI callbackUri, UUID authId)OAuth2Service.OAuthChallengestartWebUiChallenge(URI callbackUri)
-
-
-
Field Detail
-
REDIRECT_URI
public static final String REDIRECT_URI
- See Also:
- Constant Field Values
-
STATE
public static final String STATE
- See Also:
- Constant Field Values
-
NONCE
public static final String NONCE
- See Also:
- Constant Field Values
-
OPENID_SCOPE
public static final String OPENID_SCOPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OAuth2Service
@Inject public OAuth2Service(OAuth2Client client, io.jsonwebtoken.SigningKeyResolver signingKeyResolver, OAuth2Config oauth2Config) throws IOException
- Throws:
IOException
-
-
Method Detail
-
startWebUiChallenge
public OAuth2Service.OAuthChallenge startWebUiChallenge(URI callbackUri)
-
finishChallenge
public OAuth2Service.OAuthResult finishChallenge(Optional<UUID> authId, String code, URI callbackUri, Optional<String> nonce) throws ChallengeFailedException
- Throws:
ChallengeFailedException
-
getAuthId
public Optional<UUID> getAuthId(String state) throws ChallengeFailedException
- Throws:
ChallengeFailedException
-
parseClaimsJws
public io.jsonwebtoken.Jws<io.jsonwebtoken.Claims> parseClaimsJws(String token)
-
getSuccessHtml
public String getSuccessHtml()
-
-