Currently developing a SSO method for my Drupal website. I've installed simplesamlphp successfully and also configured it. I have also installed the simplesaml_auth module on my website and the SSO procedure works fine. The only problem I am having is when a user logs in via the SSO method I need to redirect them to a certain page when login is successful and I am not sure where to edit the code to be able to do this.
Any help is welcome.
Thanks!
You can add redirect condition wise in below function of simplesaml auth module
simplesamlphp_auth_loginpage() {
change drupal_goto path here to set new redirect.
}
Add a destination menu item id query parameter in the SAML login url to which it should b redirected after successful login.
Generally the SAML menu item is saml_login which makes the SAML login url like https://[SITE_NAME]/saml_login now just add it a destination query parameter like https://[SITE_NAME]/saml_login/?destination=after_login
Where after_login should be a custom menu_item defined in any of the custom module containing the callback function for redirection.
If needed any existing menu item of core or contributed module can be also used in the destination.
Related
I am using Laravel as a Backend and Angularjs as a Frontend.
I am Using this full package https://github.com/andbet39/tokenAuth for my Local setup AWT authendication it working fine,
How to do admin authendication and redirect to admin page?
How to do in Admin Panel
You have choices to make here.
There are several packages out there that can provide a full fledged admin panel for you (e.g. TCG/Voyager).
Or you could build one yourself with Laravel/Angular, this way you can customize the way you want.
The question I'm sensing here (you didn't state one clear enough) is:
How do I redirect to my admin panel?
The anwser to that comes down to this.
You need to have a route protected by auth middleware
# L5
Route::middleware(['auth'])->get('/admin', 'AdminController#index)->name('admin.index');
And put the redirect in your controller
public function login(Request $request)
{
(..)
return redirect(route('admin.index'));
}
After a successful login, the user get's redirected to the admin page.
Since this is a very basic example you should add more validation based on if the user is allowed to even view the admin page. But that is for a later stage :)
I'm migrating from Identity Server 3 and I have a question regarding controlling what page is redirected when we need to redirect from the authorize endpoint into the account controller.
The current solution using the PreAuthenticateAsync method on the UserService to look for a custom acr_value key/value in combination with prompt=login on the authorize request.
An example use case is allowing a deep link into the Register page, or into the Manage profile page if the user is logged in.
I cannot find a simple hook for controlling where we go after IDSrvr4 detects a login redirect.
I have found the IAuthorizeInteractionResponseGenerator interface and was wondering if a custom implementation ( or override the default behaviour of one of the ProcessXXXAsync methods from IdentityServer4.ResponseHandling.AuthorizeInteractionResponseGenerator ) is appropriate, but this feels like a sledgehammer approach.
The QuickStart scenario #6 from the IdSrv github repo is a close example of what I want to accomplish if you tried redirect to Register, or the Manage controller if logged in
Thanks in advance
You can configure the page you want to go to for unauthenticated users like this:
services.AddIdentityServer(options => options.UserInteraction.LoginUrl = "/account/login");
For sending authenticated users back to that page you need to to implement IAuthorizeInteractionResponseGenerator - or rather derive from the default one.
I'm trying to use Owin and OpenIdConnect to authenticate users via active directory (office 365 online). I've followed this example and I managed to create a new MVC test project and get it all working. (Settings for AD app id, tenant, Web config etc all fine).
I'm now trying to add that functionality into my existing ASP.net mvc application and I can't get the dang thing to work.
This is what I have: An Account Controller with a "void" action like this (from the example that works in my PoC but not in my actual application):
public void SignIn()
{
// Send an OpenID Connect sign-in request.
if (!Request.IsAuthenticated)
{
HttpContext.GetOwinContext().Authentication.Challenge(new AuthenticationProperties { RedirectUri = "/" }, OpenIdConnectAuthenticationDefaults.AuthenticationType);
}
}
When this action is invoked, I expect the browser to be directed to: login.microsoftonline.com..., but instead it opens this page: https://localhost:44301/Account/Login?ReturnUrl=%2fAccount%2fSignIn
It's like it's calling some sort of redirect somewhere and I can't see where.
Help!
I found the answer. I had to do 2 things:
Remove the WebMatrix dll's from the references (apparently nuget package for mvc put it there, so it might come back)
Remove authentication mode="Forms" from web.config
Thanks.
I have installed the user module in Drupal 7. How could do that when the user logs in redirect to the home page ?
thanks
I suggest two options. You could use Login redirect module or you could use Rules module and set a rule reacting to event user login and performs page redirect action. If you want, you can also filter the redirection destination by role adding a condition to the rule
In my websphere portal 8 I need to redirect user to custom page after session timeout.
As was described in all tutorials I set
redirect.logout = true
redirect.logout.url = /wps/portal/uec/uechidden/sessiontimeout
in WP_ConfigService but that had no effect.
I have check all access permissions to redirect page and portlet and other.
Also I have Logout filter in my app, but even when I removed it I've been redirected to "Your portal session has timed out because of no activity. Please start a new session at your portal Home."
My timeout settings are set for server not for one application.
Any suggestions?
To redirect to the login page (or any other page) when the session expires, use one of the following methods:
Option 1.
Extend the authentication filter chain and implement the desired logic in code. Refer to the following articles for more information: "Configuring authentication filters" and " New security APIs in WebSphere Portal".
Option 2:
Modify the ErrorSessionTimeOut jsp to add Java script to redirect to the login page when the session times out. This option is simpler to implement but you may see a momentary "flash" when the redirect occurs.
More information: http://www-01.ibm.com/support/docview.wss?uid=swg21419230
To redirect the user to custom page after session times out, you need to perform following steps.
Define ImplicitLogoutFilter by implementing com.ibm.portal.auth.ImplicitLogoutFilter.
While defining ImplicitLogoutFilter, set the the redirect url in filterChainContext using method:
filterChainContext.setRedirectURL("URL of custom page where user should be redirected to");
Configure this filter in web sphere.
In WP_ConfigService, create a new custom property redirect.logout=true
Restart the server.
Follow these steps, it works when session times out and user try to view authenticated page. In case any issue is faced, please let me know. I'll help you in resolving this issue..