Deeplink with authentication
No edit summary
No edit summary
Line 6: Line 6:
  selfVM.NavigateUrl( 'Account/TryExternalLogin?provider=OpenIdConnect&returnUrl='+SysSingleton.oclSingleton.UrlEncode(returnUrl,false),false )
  selfVM.NavigateUrl( 'Account/TryExternalLogin?provider=OpenIdConnect&returnUrl='+SysSingleton.oclSingleton.UrlEncode(returnUrl,false),false )
Note the UrlEncode ExternalLateBound function to make the url play nicely with url stacking.
Note the UrlEncode ExternalLateBound function to make the url play nicely with url stacking.
When the openIdConnect flow is finished it will use the returnUrl to navigate to the users desired view.

Revision as of 13:21, 31 January 2024

Assign accessgroups that says "false" if user is not authorized to ViewModels

When a deeplink is executed towards this ViewModel we check if the user is Authenticated already - if AccessGroup still says no(for some other reason) we will show special ViewModel AccessDenied, otherwise (not authenticated) we will navigate to Account/Login?returnUrl=UrlToTheViewModelYouTriedToReach

Implement the AccountLogin viewmodel to control how the login page displays, make sure to add a string variable redirectUrl that will get the value from above - here you can add a PeriodicAction that auto-navigates the user further on in the authentication process. For example you may want to send user directly to OpenIdConnet authentication flow. Action expression for this:

selfVM.NavigateUrl( 'Account/TryExternalLogin?provider=OpenIdConnect&returnUrl='+SysSingleton.oclSingleton.UrlEncode(returnUrl,false),false )

Note the UrlEncode ExternalLateBound function to make the url play nicely with url stacking.

When the openIdConnect flow is finished it will use the returnUrl to navigate to the users desired view.

This page was edited 49 days ago on 03/15/2024. What links here