Class SecurityOAuth2Properties

java.lang.Object
io.jmix.securityoauth2.SecurityOAuth2Properties

@ConfigurationProperties(prefix="jmix.security.oauth2") @ConstructorBinding public class SecurityOAuth2Properties extends Object
  • Constructor Details

    • SecurityOAuth2Properties

      public SecurityOAuth2Properties(@DefaultValue("client") String clientId, @DefaultValue("{noop}secret") String clientSecret, @DefaultValue("43200") int clientTokenExpirationTimeSec, @DefaultValue("31536000") int clientRefreshTokenExpirationTimeSec, @DefaultValue({"password","external","refresh_token"}) String[] clientAuthorizedGrantTypes, @DefaultValue("true") boolean supportRefreshToken, @DefaultValue("true") boolean reuseRefreshToken, @DefaultValue("true") boolean tokenMaskingEnabled, @DefaultValue("false") boolean devMode, String devUsername)
  • Method Details

    • getClientId

      public String getClientId()
      Returns:
      authorized rest client id
    • getClientSecret

      public String getClientSecret()
    • isTokenMaskingEnabled

      public boolean isTokenMaskingEnabled()
      Returns:
      token masking in application logs is enabled
    • getClientTokenExpirationTimeSec

      public int getClientTokenExpirationTimeSec()
      Returns:
      access token expiration time in seconds for the default client
    • getClientRefreshTokenExpirationTimeSec

      public int getClientRefreshTokenExpirationTimeSec()
      Returns:
      refresh token expiration time in seconds for the default client
    • getClientAuthorizedGrantTypes

      public String[] getClientAuthorizedGrantTypes()
      Returns:
      authorized grant types for the default client
    • isSupportRefreshToken

      public boolean isSupportRefreshToken()
      Returns:
      whether to support the refresh token
    • isReuseRefreshToken

      public boolean isReuseRefreshToken()
      Returns:
      whether to reuse refresh tokens (until expired)
    • isDevMode

      public boolean isDevMode()
      Development mode allows using of REST/GraphQL APIs without authentication token. Default user that is used for all REST/GraphQL APIs invocation in dev mode is specified by getDevUsername()
    • getDevUsername

      public String getDevUsername()
      Returns:
      - username that is used for development mode. See isDevMode()