Developer forum

Forum » Dynamicweb 10 » External authentication

External authentication

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I am trying to configure External Authentication with Entra.
I have configured the module, and confirmed it works on the backend, now I want to configure it for front-end.
I have activated it and it shows up in the login form:

But when I click on the "Sign in with Entra Login" I get redirected to: https://{mydomain}​/Admin/Public/Social/ExternalLogin.aspx?action=login&providerID=1 and I get a 404 error.
How should I change the login link for DW10?

Thank you,
Adrian


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Adrian

Login flow is explained here including parameters for regular login and external authtentication: https://doc.dynamicweb.dev/documentation/implementing/users/login.html?tabs=external-login%2Cimpersonation

There is also an example template to be found here: https://doc.dynamicweb.dev/documentation/implementing/content/apps/users/users-login.html

In DW10 all pages can act as the login endpoint - so no need to use ExternalLogin.aspx anymore.

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Thank you for the details.
I have found the second link you have provided and configured a login using the sample login form.

However, I am unable to make it work.

You can see it here: https://ascom.ignite.commergent.ro/nl/homepage/new-page

I have tried both the sample login template and the one shipped with Swift2.
I am using DW10.17.6.
The module displays the login form, and I can authenticate. However, the redirect is not happening, and the external login does not work.
I have tried removing the "required" attribute on the email and password, but it is the same behavior.
I have configured "Create user" and "Forgot password" pages and also defined redirects.
The External login seems to be configured correctly since I could login in the backend.

What am I missing?

Thank you,
Adrian

 

 

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Ok - 2 things.

The docs are using the wrong parameter - I just updated it to be the correct one - but not published yet.

Your implementation is using the old extranetmodule - and the example is the new authentication module.

I added the correct snippet to the end of your existing template so it works:

<form method="post">

@foreach (LoopItem provider in loginProvider)
                {
                    string iconPath = "/Files/IconsLoginProviders/";
                    string providerName = provider.GetString("ProviderName").ToLower();
                    string providerIcon = string.Empty;

                   if (providerName.Contains("azure"))
                    {
                        providerIcon = "azure";
                    }
 
                    if (providerName.Contains("google"))
                    {
                        providerIcon = "google";
                    }
            <button type="submit" name="DwExternalLoginProvider" value="@provider.GetValue("ProviderID")" class="btn btn-outline-primary btn-lg">
                            <span class="icon-3 me-2">
                                    @ReadFile(iconPath + providerIcon + ".svg")
                                </span>
                            <span> @provider.GetString("ProviderName")</span>
                        </button>
                        }
</form>
 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I have tested with the new app:

In this page:

https://ascom.ignite.commergent.ro/nl/sign-in

I suppose that after pressing the "Entra Login" button, I should be redirected to the Entra login page, right? 

I have changed the name on the submit button to DwExternalLoginProvider, and now it seems to be doing something.
I am not sure if you are supposed to enter the details used for authentication in the External provider or just be redirected to the Login provider. In the old implementation, the user is redirected to the login provider, where they need to enter the credentials.
 

Thank you,
Adrian

 

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

It will just redirect to entra and come back - you know the concept from all kinds of services.

The problem on the above page is that you have added the button that starts the external authentication inside the form that handles regular authentication and then you post all of it.

It has to be 2 different forms. They have to be post.

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,
Understood. It should work in this case.

Thank you for the confirmation and detailed explanation.

Adrian

 

You must be logged in to post in the forum