public boolean isUserInRole(String role) { if (theSubject == null) { return false; } return theSubject.getRoles().contains(role); } };
public boolean isUserInRole(String role) { if (theSubject == null) { return false; } return theSubject.getRoles().contains(role); } };
private static void tokenizeUserSubject(StringBuilder state, UserSubject subject) { if (subject != null) { // 1 state.append(tokenizeString(subject.getLogin())); state.append("."); // 2 state.append(tokenizeString(subject.getId())); state.append("."); // 3 state.append(subject.getRoles().toString()); state.append("."); // 4 state.append(subject.getProperties().toString()); } else { state.append(" "); } }
/** * @param mc the {@link MessageContext} * @return the list of roles of the logged in user or resource owner * @throws WebApplicationException with Status 401 if not authenticated */ public static List<String> resolveUserRoles(final MessageContext mc) { final OAuthContext oauth = getContext(mc); return oauth.getSubject().getRoles(); }
/** * @param mc the {@link MessageContext} * @return the list of roles of the logged in user or resource owner * @throws WebApplicationException with Status 401 if not authenticated */ public static List<String> resolveUserRoles(final MessageContext mc) { final OAuthContext oauth = getContext(mc); return oauth.getSubject().getRoles(); }
private static void tokenizeUserSubject(StringBuilder state, UserSubject subject) { if (subject != null) { // 1 state.append(tokenizeString(subject.getLogin())); state.append("."); // 2 state.append(tokenizeString(subject.getId())); state.append("."); // 3 state.append(subject.getRoles().toString()); state.append("."); // 4 state.append(subject.getProperties().toString()); } else { state.append(" "); } }
public UserSubject(UserSubject sub) { this(sub.getLogin(), sub.getId(), sub.getRoles()); this.properties = sub.getProperties(); this.am = sub.getAuthenticationMethod(); }
public UserSubject(UserSubject sub) { this(sub.getLogin(), sub.getId(), sub.getRoles()); this.properties = sub.getProperties(); this.am = sub.getAuthenticationMethod(); }
@Override protected UserSubject getGrantSubject(Message message, SamlAssertionWrapper wrapper) { UserSubject userSubject = super.getGrantSubject(message, wrapper); return new UserSubject(userSubject.getLogin(), userSubject.getRoles()); }