plain-lunch-50969
06/17/2024, 3:38 PMchilly-king-10285
06/17/2024, 3:38 PMchilly-king-10285
06/17/2024, 3:39 PMaal
parameter set to `aal2`: - /self-service/login/browser
- /self-service/login/api
For example: /self-service/login/browser?aal=aal2 /self-service/login/api?aal=aal2
If the Ory Session already has aal2
, this will result in an error. In that case, you can request to refresh the session using the second factor: /self-service/login/browser?refresh=true&aal=aal2 /self-service/login/api?refresh=true&aal=aal2
When the user successfully provides their configured second factor, the method (for example totp
) is added to the Ory Session, the Ory Session Authenticator Assurance Level (AAL) is set to aal2
, and the authenticated_at
time is set to the time when the user provides the second factor. Please note that to perform this operation, you must be authenticated by means of the oryAccessToken
method. For more details, please refer to the [Ory documentation](https://www.ory.sh/docs/kratos/mfa/step-up-authentication#trigger-dynamic-multi-factor-authentication).plain-lunch-50969
06/17/2024, 3:41 PMchilly-king-10285
06/17/2024, 3:41 PMchilly-king-10285
06/17/2024, 3:41 PMyaml selfservice: methods: password: enabled: true oidc: enabled: true # ...
For OIDC, Ory supports a variety of providers including GitHub, Apple, GitLab, Google, Facebook, and any other OpenID Connect Certified Provider. Please note that using two first authentication factors (like password
and oidc
) doesn't give the user aal2
(Authenticator Assurance Level 2). aal2
is achieved when the user completes both the first and the second authentication factor(s). For more details, please refer to the [Ory documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-login) and [Ory MFA Overview](https://www.ory.sh/docs/kratos/mfa/overview#authenticator-assurance-level-aal).plain-lunch-50969
06/17/2024, 3:42 PMchilly-king-10285
06/17/2024, 3:42 PMchilly-king-10285
06/17/2024, 3:43 PMcreateIdentity
and updateIdentity
, but these require an oryAccessToken
for authentication and their usage isn't explicitly described in the context of adding a second authentication method in the provided sources. For more detailed information, I would recommend referring to the [Ory Kratos documentation](https://www.ory.sh/docs/kratos/) or the [Ory API reference](https://www.ory.sh/docs/reference/api).plain-lunch-50969
06/17/2024, 3:46 PMchilly-king-10285
06/17/2024, 3:46 PMchilly-king-10285
06/17/2024, 3:46 PMupdateIdentity
API endpoint to modify the traits of an existing identity, which could include adding a password trait. However, please note that the updateIdentity
API overwrites the existing identity with the one provided in the request body. So, you should include all the existing traits that you want to keep in addition to the new ones you want to add. Here is an example of how you might use the updateIdentity
API to add a password trait: bash curl -d "@identity-$IDENTITY_ID.json" -X PUT https://$<http://ORY_SLUG.projects.oryapis.com/admin/identities/$IDENTITY_ID|ORY_SLUG.projects.oryapis.com/admin/identities/$IDENTITY_ID> \ -H "Authorization: Bearer $ORY_API_KEY" \ -H'Content-Type: application/json'
In the identity-$IDENTITY_ID.json
file, you would include the existing identity traits and the new password trait. However, it's important to note that the command shown does not create a password or any other type of credential for the identity. The password or other credentials would need to be handled separately, likely through a separate process involving the user. For more details, please refer to the [Ory documentation](https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks#update-identity-traits) and [Ory API reference](https://www.ory.sh/docs/reference/api#tag/identity/operation/updateIdentity).plain-lunch-50969
06/17/2024, 4:14 PMchilly-king-10285
06/17/2024, 4:14 PMchilly-king-10285
06/17/2024, 4:14 PM/self-service/settings/browser
endpoint for browser-based flows or the /self-service/settings/api
endpoint for API-based flows. 3. The user completes the password change flow by providing a new password. 4. After the password is successfully changed, the user can log in using either the OIDC method or the password method. Please note that the specifics of this process might depend on your implementation and configuration of Ory Kratos. For more details, please refer to the [Ory Kratos documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-settings#changing-passwords).