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
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.google.api.client.auth.openidconnect.IdTokenVerifier

    com.google.api.client.auth.openidconnect.IdTokenVerifier.Builder
  • Field Summary

    Fields inherited from class com.google.api.client.auth.openidconnect.IdTokenVerifier

    DEFAULT_TIME_SKEW_SECONDS
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default verifier
    OicJsonWebTokenVerifier(String jwksServerUrl, com.google.api.client.auth.openidconnect.IdTokenVerifier.Builder builder)
    Verifier with custom builder
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    JWKS verfication enabled - for tests only
    boolean
    verifyIdToken(com.google.api.client.auth.openidconnect.IdToken idToken)
    Verify real idtoken
    protected boolean
    verifyPayload(com.google.api.client.auth.openidconnect.IdToken idToken)
    hack: verify payload only if idtoken is not userinfo
    boolean
    verifyUserInfo(com.google.api.client.json.webtoken.JsonWebSignature userinfo)
    Verify userinfo jwt token

    Methods inherited from class com.google.api.client.auth.openidconnect.IdTokenVerifier

    getAcceptableTimeSkewSeconds, getAudience, getClock, getIssuer, getIssuers, verify, verifyOrThrow

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OicJsonWebTokenVerifier

      public OicJsonWebTokenVerifier()
      Default verifier
    • OicJsonWebTokenVerifier

      public OicJsonWebTokenVerifier(String jwksServerUrl, com.google.api.client.auth.openidconnect.IdTokenVerifier.Builder builder)
      Verifier with custom builder
  • Method Details

    • 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 class com.google.api.client.auth.openidconnect.IdTokenVerifier