You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log.Printf("[AUDIT] Found user %s (%s) which matches SSO info for %s. Redirecting to login! - (1)", user.Username, user.Id, userName)
19924
19924
}
19925
19925
19926
+
// check whether role is required for org
19927
+
19928
+
if org.SSOConfig.RoleRequired {
19929
+
foundRole := false
19930
+
for _, role := range openidUser.Roles {
19931
+
// check whether role matches with shuffle-admin, shuffle-user or shuffle-org-reader
19932
+
if role == "shuffle-admin" || role == "shuffle-user" || role == "shuffle-org-reader" {
19933
+
foundRole = true
19934
+
}
19935
+
}
19936
+
19937
+
if !foundRole {
19938
+
log.Printf("[WARNING] User %s (%s) role is missing in respone for org %s (%s). Please contact the administrator - (1)", user.Username, user.Id, org.Name, org.Id)
19939
+
resp.WriteHeader(401)
19940
+
resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "Role detail is missing. Please contact the administrator of org."}`)))
log.Printf("[AUDIT] Found user %s (%s) which matches SSO info for %s. Redirecting to login!- (2)", user.Username, user.Id, userName)
20067
20086
}
20068
20087
//log.Printf("SESSION: %s", user.Session)
20088
+
20089
+
// check whether role is required for org
20090
+
if org.SSOConfig.RoleRequired {
20091
+
foundRole := false
20092
+
for _, role := range openidUser.Roles {
20093
+
// check whether role matches with shuffle-admin, shuffle-user or shuffle-org-reader
20094
+
if role == "shuffle-admin" || role == "shuffle-user" || role == "shuffle-org-reader" {
20095
+
foundRole = true
20096
+
}
20097
+
}
20098
+
20099
+
if !foundRole {
20100
+
log.Printf("[WARNING] User %s (%s) role is missing in respone for org %s (%s). Please contact the administrator - (1)", user.Username, user.Id, org.Name, org.Id)
20101
+
resp.WriteHeader(401)
20102
+
resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "Role detail is missing. Please contact the administrator of org."}`)))
0 commit comments