Class OpenIdConfig


  • public class OpenIdConfig
    extends Object
    A class for configuring an Open ID session.

    This includes verification rules for OpenID Connect ID Tokens.

    • Constructor Detail

      • OpenIdConfig

        public OpenIdConfig()
    • Method Detail

      • getExpGracePeriodSecs

        public int getExpGracePeriodSecs()
        Get the expiration grace period for an ID token in seconds.
        Returns:
        the expiration grace period, default is 60.
      • setExpGracePeriodSecs

        public void setExpGracePeriodSecs​(int graceSecs)
        Set an expiration grace period for an ID token in seconds.
        Parameters:
        graceSecs - the expiration grace period
      • getExpectedAudience

        public String getExpectedAudience()
        Get the expected audience of an ID token.
        Returns:
        the expected audience, default is null
      • setExpectedAudience

        public void setExpectedAudience​(String audience)
        Set the expected audience of an ID token.
        Parameters:
        audience - the expected audience
      • getPublicKeyLocation

        public URI getPublicKeyLocation()
        Get the public signing key location of an ID token.

        If the public signing key is null, the ID Token signature is not verified

        Returns:
        the public key location, default is null
      • setPublicKeyLocation

        public void setPublicKeyLocation​(URI publicKeyLocation)
        Set the public signing key location of an ID token.

        If the public signing key location is null, the ID Token signature is not verified

        Parameters:
        publicKeyLocation - the public signing key location
      • setProofKeyPairs

        public void setProofKeyPairs​(Map<String,​KeyPair> keypairs)
        Set any externally-defined Proofing (DPoP) keypairs.

        Note: this will remove any previously set keypairs

        Parameters:
        keypairs - the keypair
      • addProofKeyPair

        public void addProofKeyPair​(String algorithm,
                                    KeyPair keypair)
        Add a Proofing (DPoP) keypair.
        Parameters:
        algorithm - the algorithm
        keypair - the keypair
      • getProofKeyPairs

        public Map<String,​KeyPair> getProofKeyPairs()
        Get any externally-defined Proofing (DPoP) keypairs.
        Returns:
        the keypairs
      • setScopes

        public void setScopes​(String... scopes)
        Set any OAuth 2.0 scope values.

        Note: by default, the scopes are "webid" and "openid". Setting new values will clear any existing values.

        Parameters:
        scopes - the scope values
      • getScopes

        public List<String> getScopes()
        Get any OAuth 2.0 scope values.
        Returns:
        the scope values