Interface B2BMagicLinks
-
- All Implemented Interfaces:
public interface B2BMagicLinksThe B2BMagicLinks interface provides methods for sending and authenticating users with Email Magic Links.
Call the StytchB2BClient.magicLinks.email.loginOrSignup() method to request an email magic link for a user to log in or create an account, based on if the email is associated with a user already. A new or pending user will receive a signup magic link. An active user will receive a login magic link.
If you have connected your deeplink handler with StytchB2BClient, the resulting magic link should be detected by your application and automatically authenticated (via the StytchB2BClient.handle() method). See the instructions in the top-level README for information on handling deeplink intents.
If you are not using our deeplink handler, you must parse out the token from the deeplink yourself and pass it to the StytchB2BClient.magicLinks.authenticate() method.
Call the
StytchB2BClient.magicLinks.discovery.send()method to send an invite email to a new Member to join an Organization.Call the
StytchB2BClient.magicLinks.discovery.authenticate()method to authenticate a Member with a Magic Link.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classB2BMagicLinks.AuthParametersData class used for wrapping parameters used with MagicLinks authentication
public final classB2BMagicLinks.DiscoveryAuthenticateParametersA data class used for wrapping parameters used for authenticating a discovery magic link
public interfaceB2BMagicLinks.EmailMagicLinksProvides all possible ways to call EmailMagicLinks endpoints
-
Method Summary
Modifier and Type Method Description abstract StytchResult<B2BEMLAuthenticateData>authenticate(B2BMagicLinks.AuthParameters parameters)Authenticate a Member with a Magic Link. abstract Unitauthenticate(B2BMagicLinks.AuthParameters parameters, Function1<StytchResult<B2BEMLAuthenticateData>, Unit> callback)Authenticate a Member with a Magic Link. abstract CompletableFuture<StytchResult<B2BEMLAuthenticateData>>authenticateCompletable(B2BMagicLinks.AuthParameters parameters)Authenticate a Member with a Magic Link. abstract StytchResult<DiscoveryAuthenticateResponseData>discoveryAuthenticate(B2BMagicLinks.DiscoveryAuthenticateParameters parameters)Authenticate a Member with a Discovery Magic Link. abstract UnitdiscoveryAuthenticate(B2BMagicLinks.DiscoveryAuthenticateParameters parameters, Function1<StytchResult<DiscoveryAuthenticateResponseData>, Unit> callback)Authenticate a Member with a Discovery Magic Link. abstract CompletableFuture<StytchResult<DiscoveryAuthenticateResponseData>>discoveryAuthenticateCompletable(B2BMagicLinks.DiscoveryAuthenticateParameters parameters)Authenticate a Member with a Discovery Magic Link. abstract B2BMagicLinks.EmailMagicLinksgetEmail()Public variable that exposes an instance of EmailMagicLinks -
-
Method Detail
-
authenticate
abstract StytchResult<B2BEMLAuthenticateData> authenticate(B2BMagicLinks.AuthParameters parameters)
Authenticate a Member with a Magic Link. This endpoint requires a Magic Link token that is not expired or previously used. Provide a value for session_duration_minutes to receive a Session. If the Member’s status is pending, they will be updated to active.
- Parameters:
parameters- required to authenticate- Returns:
EMLAuthenticateResponse
-
authenticate
abstract Unit authenticate(B2BMagicLinks.AuthParameters parameters, Function1<StytchResult<B2BEMLAuthenticateData>, Unit> callback)
Authenticate a Member with a Magic Link. This endpoint requires a Magic Link token that is not expired or previously used. Provide a value for session_duration_minutes to receive a Session. If the Member’s status is pending, they will be updated to active.
- Parameters:
parameters- required to authenticatecallback- A callback that receives an EMLAuthenticateResponse
-
authenticateCompletable
abstract CompletableFuture<StytchResult<B2BEMLAuthenticateData>> authenticateCompletable(B2BMagicLinks.AuthParameters parameters)
Authenticate a Member with a Magic Link. This endpoint requires a Magic Link token that is not expired or previously used. Provide a value for session_duration_minutes to receive a Session. If the Member’s status is pending, they will be updated to active.
- Parameters:
parameters- required to authenticate- Returns:
EMLAuthenticateResponse
-
discoveryAuthenticate
abstract StytchResult<DiscoveryAuthenticateResponseData> discoveryAuthenticate(B2BMagicLinks.DiscoveryAuthenticateParameters parameters)
Authenticate a Member with a Discovery Magic Link. This endpoint requires a Magic Link token that is not expired or previously used.
- Parameters:
parameters- required to authenticate- Returns:
DiscoveryEMLAuthResponse
-
discoveryAuthenticate
abstract Unit discoveryAuthenticate(B2BMagicLinks.DiscoveryAuthenticateParameters parameters, Function1<StytchResult<DiscoveryAuthenticateResponseData>, Unit> callback)
Authenticate a Member with a Discovery Magic Link. This endpoint requires a Magic Link token that is not expired or previously used.
- Parameters:
parameters- required to authenticatecallback- a callback that receives a DiscoveryEMLAuthResponse
-
discoveryAuthenticateCompletable
abstract CompletableFuture<StytchResult<DiscoveryAuthenticateResponseData>> discoveryAuthenticateCompletable(B2BMagicLinks.DiscoveryAuthenticateParameters parameters)
Authenticate a Member with a Discovery Magic Link. This endpoint requires a Magic Link token that is not expired or previously used.
- Parameters:
parameters- required to authenticate- Returns:
DiscoveryEMLAuthResponse
-
getEmail
abstract B2BMagicLinks.EmailMagicLinks getEmail()
Public variable that exposes an instance of EmailMagicLinks
-
-
-
-