Class EmailRefreshTokenManagerImpl
java.lang.Object
io.jmix.email.authentication.impl.EmailRefreshTokenManagerImpl
- All Implemented Interfaces:
EmailRefreshTokenManager
@NullMarked
@Component("email_EmailRefreshTokenManager")
public class EmailRefreshTokenManagerImpl
extends Object
implements EmailRefreshTokenManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final UnconstrainedDataManagerprotected static final UUIDprotected static final Stringprotected final EmailerProperties -
Constructor Summary
ConstructorsConstructorDescriptionEmailRefreshTokenManagerImpl(UnconstrainedDataManager dataManager, EmailerProperties emailerProperties) -
Method Summary
Modifier and TypeMethodDescriptionGets the OAuth2 client type the stored refresh token was issued to.Gets current value of refresh token.@Nullable RefreshTokenLoads refresh token instance from database.storeRefreshTokenValue(String refreshTokenValue) Stores provided token value to database.storeRefreshTokenValue(String refreshTokenValue, OAuth2ClientType clientType) Stores provided token value and the OAuth2 client type the token was issued to.
-
Field Details
-
DEFAULT_REFRESH_TOKEN_ID
-
DEFAULT_REFRESH_TOKEN_REGISTRATION_ID
- See Also:
-
dataManager
-
emailerProperties
-
-
Constructor Details
-
EmailRefreshTokenManagerImpl
public EmailRefreshTokenManagerImpl(UnconstrainedDataManager dataManager, EmailerProperties emailerProperties)
-
-
Method Details
-
storeRefreshTokenValue
Description copied from interface:EmailRefreshTokenManagerStores provided token value to database. It will override previous value of refresh token.- Specified by:
storeRefreshTokenValuein interfaceEmailRefreshTokenManager- Parameters:
refreshTokenValue- token value- Returns:
- stored
RefreshTokeninstance
-
storeRefreshTokenValue
Description copied from interface:EmailRefreshTokenManagerStores provided token value and the OAuth2 client type the token was issued to. It will override previous value of refresh token.- Specified by:
storeRefreshTokenValuein interfaceEmailRefreshTokenManager- Parameters:
refreshTokenValue- token valueclientType- client type the token was issued to- Returns:
- stored
RefreshTokeninstance
-
getRefreshTokenClientType
Description copied from interface:EmailRefreshTokenManagerGets the OAuth2 client type the stored refresh token was issued to.- Specified by:
getRefreshTokenClientTypein interfaceEmailRefreshTokenManager- Returns:
- stored client type, or
OAuth2ClientType.CONFIDENTIALwhen unknown
-
getRefreshTokenValue
Description copied from interface:EmailRefreshTokenManagerGets current value of refresh token.- Specified by:
getRefreshTokenValuein interfaceEmailRefreshTokenManager- Returns:
- token value stored in database. If no token value is stored, the initial value from the 'jmix.email.oauth2.refresh-token' application property is returned. Once a token is stored in the database, the stored value always takes precedence over the property.
-
loadRefreshToken
Description copied from interface:EmailRefreshTokenManagerLoads refresh token instance from database.- Specified by:
loadRefreshTokenin interfaceEmailRefreshTokenManager- Returns:
RefreshTokeninstance stored in database or null if no token is stored
-