protected boolean isValidPublicClient(Client client, String clientId) { return canSupportPublicClients && !client.isConfidential() && client.getClientSecret() == null; }
public UserSubject(UserSubject sub) { this(sub.getLogin(), sub.getId(), sub.getRoles()); this.properties = sub.getProperties(); this.am = sub.getAuthenticationMethod(); }
public UserSubject(String login, String id, List<String> roles) { this.login = login; this.id = id != null ? id : newId(); this.roles = roles; }
protected static boolean isTokenMatched(ServerAccessToken token, Client c, UserSubject sub) { if (token != null && (c == null || token.getClient().getClientId().equals(c.getClientId()))) { UserSubject tokenSub = token.getSubject(); if (sub == null || tokenSub != null && tokenSub.getLogin().equals(sub.getLogin())) { return true; } } return false; } public void setClients(List<Client> clients) {
/** * @param mc the {@link MessageContext} * @return the name of the UserSubject of the logged in user or resource owner * @throws WebApplicationException with Status 401 if not authenticated */ public static String resolveUserName(final MessageContext mc) { final OAuthContext oauth = getContext(mc); return oauth.getSubject().getLogin(); }
protected AbstractAuthSupplier(String type) { clientAccessToken = new ClientAccessToken(); clientAccessToken.setTokenType(type); } public void setAccessToken(String accessToken) {
/** * @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 id of the UserSubject of the logged in user or resource owner * @throws WebApplicationException with Status 401 if not authenticated */ public static String resolveUserId(final MessageContext mc) { final OAuthContext oauth = getContext(mc); return oauth.getSubject().getId(); }
protected static boolean isClientMatched(Client c, UserSubject resourceOwner) { return resourceOwner == null || c.getResourceOwnerSubject() != null && c.getResourceOwnerSubject().getLogin().equals(resourceOwner.getLogin()); } protected static boolean isTokenMatched(ServerAccessToken token, Client c, UserSubject sub) {
public String getName(UserSubject subject) { return subject.getLogin(); } }
public void setAccessToken(String accessToken) { clientAccessToken.setTokenKey(accessToken); } protected String createAuthorizationHeader() {
protected static boolean isTokenMatched(ServerAccessToken token, Client c, UserSubject sub) { if (token != null && (c == null || token.getClient().getClientId().equals(c.getClientId()))) { UserSubject tokenSub = token.getSubject(); if (sub == null || tokenSub != null && tokenSub.getLogin().equals(sub.getLogin())) { return true; } } return false; } public void setClients(List<Client> clients) {
/** * @param mc the {@link MessageContext} * @return the name of the UserSubject of the logged in user or resource owner * @throws WebApplicationException with Status 401 if not authenticated */ public static String resolveUserName(final MessageContext mc) { final OAuthContext oauth = getContext(mc); return oauth.getSubject().getLogin(); }
/** * @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 id of the UserSubject of the logged in user or resource owner * @throws WebApplicationException with Status 401 if not authenticated */ public static String resolveUserId(final MessageContext mc) { final OAuthContext oauth = getContext(mc); return oauth.getSubject().getId(); }
protected static boolean isClientMatched(Client c, UserSubject resourceOwner) { return resourceOwner == null || c.getResourceOwnerSubject() != null && c.getResourceOwnerSubject().getLogin().equals(resourceOwner.getLogin()); } protected static boolean isTokenMatched(ServerAccessToken token, Client c, UserSubject sub) {
public String getName(UserSubject subject) { return subject.getLogin(); } }
@Override protected boolean canSupportPublicClient(Client c) { return canSupportPublicClients && !c.isConfidential() && c.getClientSecret() == null; }
public UserSubject(String login, String id) { this.login = login; this.id = id != null ? id : newId(); }
protected boolean isValidPublicClient(Client client, String clientId) { return canSupportPublicClients && !client.isConfidential() && client.getClientSecret() == null; }