Package org.jenkinsci.plugins.oic
Class OicJsonWebTokenVerifier
- java.lang.Object
-
- com.google.api.client.auth.openidconnect.IdTokenVerifier
-
- org.jenkinsci.plugins.oic.OicJsonWebTokenVerifier
-
public class OicJsonWebTokenVerifier extends com.google.api.client.auth.openidconnect.IdTokenVerifier
Extend IdTokenVerifier to verify UserInfo webtoken
-
-
Constructor Summary
Constructors Constructor Description OicJsonWebTokenVerifier()
Default verifierOicJsonWebTokenVerifier(String jwksServerUrl, com.google.api.client.auth.openidconnect.IdTokenVerifier.Builder builder)
Verifier with custom builder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isJwksServerUrlAvailable()
JWKS verfication enabled - for tests onlyboolean
verifyIdToken(com.google.api.client.auth.openidconnect.IdToken idToken)
Verify real idtokenprotected boolean
verifyPayload(com.google.api.client.auth.openidconnect.IdToken idToken)
hack: verify payload only if idtoken is not userinfoboolean
verifyUserInfo(com.google.api.client.json.webtoken.JsonWebSignature userinfo)
Verify userinfo jwt token
-
-
-
Constructor Detail
-
OicJsonWebTokenVerifier
public OicJsonWebTokenVerifier()
Default verifier
-
OicJsonWebTokenVerifier
public OicJsonWebTokenVerifier(String jwksServerUrl, com.google.api.client.auth.openidconnect.IdTokenVerifier.Builder builder)
Verifier with custom builder
-
-
Method Detail
-
isJwksServerUrlAvailable
public boolean isJwksServerUrlAvailable()
JWKS verfication enabled - for tests only
-
verifyIdToken
public boolean verifyIdToken(com.google.api.client.auth.openidconnect.IdToken idToken) throws IOException
Verify real idtoken- Throws:
IOException
-
verifyUserInfo
public boolean verifyUserInfo(com.google.api.client.json.webtoken.JsonWebSignature userinfo) throws IOException
Verify userinfo jwt token- Throws:
IOException
-
verifyPayload
protected boolean verifyPayload(com.google.api.client.auth.openidconnect.IdToken idToken)
hack: verify payload only if idtoken is not userinfo- Overrides:
verifyPayload
in classcom.google.api.client.auth.openidconnect.IdTokenVerifier
-
-