Package dev.sigstore.oidc.client
Class WebOidcClient
- java.lang.Object
-
- dev.sigstore.oidc.client.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceWebOidcClient.BrowserHandlerInterface for allowing custom browser handlers for OauthClients.static classWebOidcClient.Builderstatic classWebOidcClient.OIDCEndpointsInternal.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPUBLIC_DEX_ISSUERstatic java.lang.StringSTAGING_DEX_ISSUER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static WebOidcClient.Builderbuilder()OidcTokengetIDToken(java.util.Map<java.lang.String,java.lang.String> env)Get an id token from the oidc provider with openid and email scopesbooleanisEnabled(java.util.Map<java.lang.String,java.lang.String> env)This provider is usually enabled unless we're in CI.
-
-
-
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
-
builder
public static WebOidcClient.Builder builder()
-
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:
isEnabledin interfaceOidcClient- 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:
getIDTokenin interfaceOidcClient- Returns:
- an openid token with additional email scopes
- Throws:
OidcException- if an error occurs doing the authorization flow
-
-