Skip to main content
Function Signature
A PortalAuth method. Idempotent and side-effect free, so it is safe to call on every sign-in screen and safe to retry. Returns
  • AuthMethodsResult: Contains the following:
    • allowedAuthMethods: [AuthMethod], the enabled methods: .emailMagicLink, .google, .apple. Values this SDK version does not recognize are dropped, never surfaced.
    • autoCreateWallet: Bool, the environment’s Auto-create wallet setting. A hint for your app; Portal never creates the wallet itself.
Throws
  • PortalAuthError.malformedResponse(path:missing:): The response did not carry the documented fields.
  • PortalRequestsError.unauthorized: The Auth Environment ID does not match an environment, or authentication is switched off for it.
  • Other transport errors unchanged.
Notes
  • A two-factor requirement is not observable here. It only shows up as .totpRequired in the result of handleRedirect or signInWith*.
  • A provider that is enabled but incompletely configured still appears in allowedAuthMethods, and makes loginWith* / signInWith* fail for every provider. See loginWithGoogle.
  • Call it again after adopting a session to decide whether to create a wallet; see Create or reuse the wallet.
  • Available starting from SDK version 8.0.0.
Example Usage
Related Documentation