Class OAuthUtil

java.lang.Object
com.skava.auth.util.OAuthUtil

public final class OAuthUtil extends Object
Author:
Infosys Equinox
  • Method Details

    • createIdToken

      public static String createIdToken(String issuer, org.springframework.security.core.Authentication authentication, AuthorizationRequestVO authorizationRequest, OAuthClient oAuthClient, Long clientTokenExpireTime, org.springframework.context.MessageSource messageSource)
      This method creates the id_token for the user who wishes to access the client application.
      Parameters:
      issuer - a String object.
      authentication - a Authentication object.
      authorizationRequest - a AuthorizationRequestVO object.
      oAuthClient - a OAuthClient object.
      clientTokenExpireTime - a Long object.
      messageSource - a MessageSource object.
      Returns:
      a String object.
    • loadIssuer

      public static String loadIssuer(Long collectionId, String attributeName, String defaultIssuer, CollectionPropertyRepository collectionPropertyRepository)
      This method load the issuer name from the collection property.
      Parameters:
      collectionId - a Long object.
      attributeName - a String object.
      defaultIssuer - a String object.
      collectionPropertyRepository - a CollectionPropertyRepository object.
      Returns:
      a String object.
    • loadClientTokenExpireTime

      public static Long loadClientTokenExpireTime(Long collectionId, String attributeName, Long defaultExpireTime, CollectionPropertyRepository collectionPropertyRepository)
      This method return the client token expire time from collection property.
      Parameters:
      collectionId - a Long object.
      attributeName - a String object.
      defaultExpireTime - a Long object.
      collectionPropertyRepository - a CollectionPropertyRepository object.
      Returns:
      a Long object.
    • loadCollectionProperty

      public static Optional<CollectionProperty> loadCollectionProperty(Long collectionId, String attributeName, CollectionPropertyRepository collectionPropertyRepository)
      This method load the collection property by using collection identifier and collection attribute name.
      Parameters:
      collectionId - a Long object.
      attributeName - a String object,
      collectionPropertyRepository - a CollectionPropertyRepository object.
      Returns:
      a Optional of CollectionProperty object.
    • setClientSecretExpiryTimeAndAlgorithm

      public static void setClientSecretExpiryTimeAndAlgorithm(OAuthClientVO input)
      setClientSecretExpiryTime - This function is used to set the default client secret expiry time.
      Parameters:
      input - of type OAuthClientVO
    • getNewSecretExpireTime

      public static Date getNewSecretExpireTime()
      This method will return the expire time of the new secret key.
      Returns:
      a Date object. which holds the expire time of the secret.
    • validateSecretExpireTime

      public static void validateSecretExpireTime(Date expireTime, org.springframework.context.MessageSource messageSource)
      This method validate secret's validity time.
      Parameters:
      expireTime - a Date object. which holds the expire date of the client secret.