Redirect users in specific user group to a given page after login using simpleSAMLphp

StackOverflow https://stackoverflow.com/questions/20552374

  •  01-09-2022
  •  | 
  •  

I have one group of users who have more limited access to a site. I would like it so that most users (in the general access group) are forwarded to the front page of the site, but a specific group be forwarded to a particular page after login. I am sure this must be possible but I can't find it in the documentation.

有帮助吗?

解决方案 2

I ended up putting a redirect in the header based on specific attributes I had given to types of user. Here's my approach in case anyone searches their way to this

if($_SESSION['attributes']['Usertype'][0] == "guest")
{
header("Location:  https://www.mypage.org/?page=guest-account-creation");
die();
}

if($_SESSION['attributes']['Usertype'][0] == "group 1")
{
header("Location:  https://www.mypage.org/?page=just-for-group-1");
die();
}

if($_SESSION['attributes']['Usertype'][0] == "group 2")
{
header("Location: https://www.mypage.org/?page=just-for-group-1");
die();
}

I put this along with the SAML code right at the head of the php of my pages, and it works well. Note this is not a security based solution, just a user flow one (I am not using this to secure certain site areas from certain users, just getting them to the most useful place).

其他提示

if($user_role == 1){
//redirect user group
}
else{
//redirect all other user groups
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top