Recently I have been looking at customising the Adxstudio portal web app (the MVC app). One of the things I needed to do was to create a link that would take users to the login page for the portal. Our portal is configured to use ADFS as the external ID provider, and the link needs to take users straight to the ADFS login page.
The Adxstudio framework code has an extension method on the UrlHelper class that allows you to easily do this, namely SignInUrl(). This method accepts an optional returnUrl parameter, which is the URL that users will be redirected to once successfully authenticated.
From the C# code-behind, you can instantiate an instance of UrlHelper and invoke the extension method like so:
lnkLogin.NavigateUrl = new UrlHelper(Request.RequestContext).SignInUrl("/private/dashboard");
From the ASPX markup, you can use the Url property of the page/user-control to invoke the method:
<a href="<%: Url.SignInUrl() %>">Sign in</a>
The method uses the authentication settings configured for the website to return the correct sign-in URL for the external ID provider.
Important: This method returns the sign-in URL of the external ID provider only if that provider is configured to be used as the only provider for the website.
You can configure this using the Authentication/Registration/LoginButtonAuthenticationType Site Settings in CRM configuration. For ADFS for example, set the value of this Site Setting to be the same as the Authentication/Registration/LoginButtonAuthenticationType Site Setting.
For more information on these two Site Settings, please see https://docs.microsoft.com/en-us/dynamics365/customer-engagement/portals/set-authentication-identity and https://community.adxstudio.com/products/adxstudio-portals/documentation/configuration-guide/portal-authentication/asp.net-identity-authentication/ws-federation-provider-settings/