Package com.skava.auth.util
Class OAuthUtil
java.lang.Object
com.skava.auth.util.OAuthUtil
- Author:
- Infosys Equinox
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.static Date
This method will return the expire time of the new secret key.static Long
loadClientTokenExpireTime
(Long collectionId, String attributeName, Long defaultExpireTime, CollectionPropertyRepository collectionPropertyRepository) This method return the client token expire time from collection property.static Optional<CollectionProperty>
loadCollectionProperty
(Long collectionId, String attributeName, CollectionPropertyRepository collectionPropertyRepository) This method load the collection property by using collection identifier and collection attribute name.static String
loadIssuer
(Long collectionId, String attributeName, String defaultIssuer, CollectionPropertyRepository collectionPropertyRepository) This method load the issuer name from the collection property.static void
setClientSecretExpiryTime - This function is used to set the default client secret expiry time.static void
validateSecretExpireTime
(Date expireTime, org.springframework.context.MessageSource messageSource) This method validate secret's validity time.
-
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
- aString
object.authentication
- aAuthentication
object.authorizationRequest
- aAuthorizationRequestVO
object.oAuthClient
- aOAuthClient
object.clientTokenExpireTime
- aLong
object.messageSource
- aMessageSource
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
- aLong
object.attributeName
- aString
object.defaultIssuer
- aString
object.collectionPropertyRepository
- aCollectionPropertyRepository
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
- aLong
object.attributeName
- aString
object.defaultExpireTime
- aLong
object.collectionPropertyRepository
- aCollectionPropertyRepository
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
- aLong
object.attributeName
- aString
object,collectionPropertyRepository
- aCollectionPropertyRepository
object.- Returns:
- a
Optional
ofCollectionProperty
object.
-
setClientSecretExpiryTimeAndAlgorithm
setClientSecretExpiryTime - This function is used to set the default client secret expiry time.- Parameters:
input
- of typeOAuthClientVO
-
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
- aDate
object. which holds the expire date of the client secret.
-