Create a session
Here you will learn, how to create a session.
At the end, you get a token, which is required for further updates of this session.
First, we have to initialize the class.
Set the user identifier
At the beginning, we have to set a user identifier. This can be the user id or the login name. You can't use both. This will produce an error.
or
Checks
You can send several checks Zitadel, such as the password or 2-factor codes. The session is only created if all checks are successful.
Password
External Identity Providers
You get the required values from the IDP-class.
TOTP-Code
SMS-Code
Here, you will learn, how to get the SMS-Code
Email-Code
Here, you will learn, how to get the Email-Code
Challenges
You can set challenges, e.g. an OTP-SMS-Code. If you set a challenge, you can get the code after performing the request.
SMS-OTP-Code
After performing the request, you can get the code with:
Email-OTP-Code
After performing the request, you can get the code with:
Lifetime
You can set a lifetime in seconds after which the session will be automatically invalidated.
Performing the request
After performing this request, you can get the Session-ID and the Session-Token.