Class WebOidcClient

  • All Implemented Interfaces:
    OidcClient

    public class WebOidcClient
    extends java.lang.Object
    implements OidcClient
    A client to obtain oidc tokens from an oauth provider via web workflow for use with sigstore. By default this client is configued to use the public sigstore dex instance.
    • Field Detail

      • PUBLIC_DEX_ISSUER

        public static final java.lang.String PUBLIC_DEX_ISSUER
        See Also:
        Constant Field Values
      • STAGING_DEX_ISSUER

        public static final java.lang.String STAGING_DEX_ISSUER
        See Also:
        Constant Field Values
    • Method Detail

      • isEnabled

        public boolean isEnabled​(java.util.Map<java.lang.String,​java.lang.String> env)
        This provider is usually enabled unless we're in CI.
        Specified by:
        isEnabled in interface OidcClient
        Parameters:
        env - the configured system environment
        Returns:
        true if we should use credentials from this client
      • getIDToken

        public OidcToken getIDToken​(java.util.Map<java.lang.String,​java.lang.String> env)
                             throws OidcException
        Get an id token from the oidc provider with openid and email scopes
        Specified by:
        getIDToken in interface OidcClient
        Returns:
        an openid token with additional email scopes
        Throws:
        OidcException - if an error occurs doing the authorization flow