@Override protected boolean canRedirectUriBeEmpty(Client c) { // If a redirect URI is empty then the code will be returned out of band, // typically will be returned directly to a human user return (c.isConfidential() && canSupportEmptyRedirectForPrivateClients || canSupportPublicClient(c)) && c.getRedirectUris().isEmpty(); }
@Override protected boolean canRedirectUriBeEmpty(Client c) { // If a redirect URI is empty then the code will be returned out of band, // typically will be returned directly to a human user return (c.isConfidential() && canSupportEmptyRedirectForPrivateClients || canSupportPublicClient(c)) && c.getRedirectUris().isEmpty(); }
protected String validateRedirectUri(Client client, String redirectUri) { List<String> uris = client.getRedirectUris(); if (redirectUri != null) { if (!uris.contains(redirectUri)) { reportInvalidRequestError("Client Redirect Uri is invalid"); } } else if (uris.size() == 1 && useRegisteredRedirectUriIfPossible) { redirectUri = uris.get(0); } if (redirectUri == null && uris.isEmpty() && !canRedirectUriBeEmpty(client)) { reportInvalidRequestError("Client Redirect Uri is invalid"); } if (redirectUri != null && matchRedirectUriWithApplicationUri && client.getApplicationWebUri() != null && !redirectUri.startsWith(client.getApplicationWebUri())) { reportInvalidRequestError("Client Redirect Uri is invalid"); } return redirectUri; }
protected String validateRedirectUri(Client client, String redirectUri) { List<String> uris = client.getRedirectUris(); if (redirectUri != null) { if (!uris.contains(redirectUri)) { reportInvalidRequestError("Client Redirect Uri is invalid"); } } else if (uris.size() == 1 && useRegisteredRedirectUriIfPossible) { redirectUri = uris.get(0); } if (redirectUri == null && uris.isEmpty() && !canRedirectUriBeEmpty(client)) { reportInvalidRequestError("Client Redirect Uri is invalid"); } if (redirectUri != null && matchRedirectUriWithApplicationUri && client.getApplicationWebUri() != null && !redirectUri.startsWith(client.getApplicationWebUri())) { reportInvalidRequestError("Client Redirect Uri is invalid"); } return redirectUri; }
state.append(SEP); state.append(client.getRedirectUris().toString()); state.append(SEP);
state.append(SEP); state.append(client.getRedirectUris().toString()); state.append(SEP);
&& (client.getRedirectUris().size() != 1 || !client.getRedirectUris().contains(expectedRedirectUri))) { throw new OAuthServiceException(OAuthConstants.INVALID_REQUEST);
&& (client.getRedirectUris().size() != 1 || !client.getRedirectUris().contains(expectedRedirectUri))) { throw new OAuthServiceException(OAuthConstants.INVALID_REQUEST);
reg.setGrantTypes(c.getAllowedGrantTypes()); reg.setApplicationType(c.isConfidential() ? "web" : "native"); if (!c.getRedirectUris().isEmpty()) { reg.setRedirectUris(c.getRedirectUris());
reg.setGrantTypes(c.getAllowedGrantTypes()); reg.setApplicationType(c.isConfidential() ? "web" : "native"); if (!c.getRedirectUris().isEmpty()) { reg.setRedirectUris(c.getRedirectUris());