How to get continuation_token on the first step from Native authentication API reference?

Rodion Liuborets 0 Reputation points
2024-07-11T13:30:46.08+00:00

I did everything step-by-step from https://learn.microsoft.com/en-us/entra/identity-platform/reference-native-authentication-api

I need only Sign-in logic. On the first step I make request

POST https://{tenant_subdomain}.ciamlogin.com/{tenant_subdomain}.onmicrosoft.com/oauth2/v2.0/initiate
Content-Type: application/x-www-form-urlencoded

client_id=00001111-aaaa-2222-bbbb-3333cccc4444
&challenge_type=password redirect
&username=contoso-consumer@contoso.com

And I expected Success Response with continuation_token. But I always get challenge_type = redirect. I need token to make next steps and finally get tokens to use on my backend-api.

I created app, users as in article. Where should I configure to get continuation_token ? Because I do not need redirect. We will use our custom front for Authentication. Thx for response.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,222 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Navya 12,650 Reputation points Microsoft Vendor
    2024-07-15T10:00:49.1866667+00:00

    Hi @Rodion Liuborets

    Thank you for posting this in Microsoft Q&A.

    I understand you want get continuation_token on the first step from Native authentication API.

    We will get challenge_type = redirect If an app can't support a required authentication method by Microsoft Entra, a fallback to the web-based authentication flow is needed. In this scenario, Microsoft Entra informs the app by returning a redirect challenge type in its response.

    Microsoft Entra's native authentication API supports sign-up and sign-in for two authentication methods:

    1.Email with password, which supports sign-up and sign-in with an email and password, and self-service password reset (SSPR).

    2.Email one-time passcode, which supports sign-up and sign-in with email one-time passcode.

    The value is expected to oob redirect for email one-time passcode and oob password redirect for email with password authentication method.

    Could you please confirm which authentication method you are using: Email with password or Email one-time passcode? Also, can you ensure that the same authentication method is used for both sign-up and sign-in?

    If you are using Email with password The user that you use to sign in has to be created via an email with password user flow. For a given authentication method, the challenge type values an app sends to Microsoft Entra during sign-up flow are same to when the app signs in. For example, the email with password authentication method uses oob, password and redirect challenge type values for both sign-up and sign-in flows.

    Thanks,

    Navya

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.