Package org.localify.auth.login
Class LoginService
java.lang.Object
org.localify.auth.login.LoginService
Generic login service for handling OAuth callbacks and other login-related tasks.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisInvalidRedirectUrl(String passedUrl) Checks if a given redirect URL is invalid.static booleanisNonceValid(String nonce) Preliminary sanity checking of nonce - attempts to decode and ensures it is 32 bytes.loginCallback(UserCallbackTokenPayload payload) Handles the login callback from the OAuth provider.makeCallbackUri(User user, UserOAuthRedirectParams params) Creates a callback URI with a new login token.voidValidates the OAuth redirect parameters.
-
Constructor Details
-
LoginService
public LoginService()
-
-
Method Details
-
loginCallback
Handles the login callback from the OAuth provider.- Parameters:
payload- The payload from the callback.- Returns:
- The authenticated user.
-
isInvalidRedirectUrl
Checks if a given redirect URL is invalid.- Parameters:
passedUrl- The URL to check.- Returns:
- True if the URL is invalid, false otherwise.
-
makeCallbackUri
Creates a callback URI with a new login token.- Parameters:
user- The user to create the token for.params- The OAuth redirect parameters.- Returns:
- The callback URI.
-
isNonceValid
Preliminary sanity checking of nonce - attempts to decode and ensures it is 32 bytes.- Parameters:
nonce- The nonce to check.- Returns:
- True if the nonce is valid, false otherwise.
-
validateRedirectParams
Validates the OAuth redirect parameters.- Parameters:
params- The parameters to validate.
-