Hans Karlsen (talk | contribs) No edit summary |
m ((username removed) (log details removed)) |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
Assign accessgroups that | Assign [[Documentation:AccessGroups, InterestGroups and ViewModel-Enable|accessgroups]] that say "false" if user is not authorized to ViewModels. | ||
When a deeplink is executed towards this ViewModel we check if the user is Authenticated already | 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 | Implement the [[Documentation:Customizing login and other account ui MVC|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 ) | 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 [[SysSingleton.UrlEncode|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. | When the openIdConnect flow is finished, it will use the returnUrl to navigate to the users desired view. | ||
{{Edited|July|12|2024}} | |||
[[Category:Access groups]] |
Latest revision as of 06:13, 15 March 2024
Assign accessgroups that say "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.