private boolean isClient(String sourceId) { return OrcidStringUtils.isClientId(sourceId) || clientDetailsManagerReadOnly.isLegacyClientId(sourceId); }
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws AuthenticationException, IOException, ServletException { String clientId = request.getParameter("client_id"); if (!(request instanceof HttpServletRequest) || !(response instanceof HttpServletResponse)) { throw new ServletException("RevokeTokenEndpointFilter just supports HTTP requests"); } if (clientId != null && (OrcidStringUtils.isValidOrcid(clientId) || OrcidStringUtils.isClientId(clientId))) { String clientSecret = request.getParameter("client_secret"); if (clientSecret == null) { clientSecret = ""; } UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(clientId, clientSecret); try { Authentication auth = clientAuthenticationProvider.authenticate(authRequest); SecurityContextHolder.getContext().setAuthentication(auth); } catch (AuthenticationException failed) { oauthAuthenticationEntryPoint.commence((HttpServletRequest) request, (HttpServletResponse) response, failed); return; } } chain.doFilter(request, response); }
@Override public OrcidIdBase getOrcidIdBase(String id) { OrcidIdBase orcidId = new OrcidIdBase(); String correctedBaseUri = baseUri.replace("https", "http"); try { URI uri = new URI(correctedBaseUri); orcidId.setHost(uri.getHost()); } catch (URISyntaxException e) { throw new RuntimeException("Error parsing base uri", e); } if (OrcidStringUtils.isClientId(id)) { correctedBaseUri += "/client"; } orcidId.setUri(correctedBaseUri + "/" + id); orcidId.setPath(id); return orcidId; }
public OrcidIdBase getOrcidIdBase(String id) { OrcidIdBase orcidId = new OrcidIdBase(); String correctedBaseUri = baseUri.replace("https", "http"); try { URI uri = new URI(correctedBaseUri); orcidId.setHost(uri.getHost()); } catch (URISyntaxException e) { throw new RuntimeException("Error parsing base uri", e); } if (OrcidStringUtils.isClientId(id)) { correctedBaseUri += "/client"; } orcidId.setUri(correctedBaseUri + "/" + id); orcidId.setPath(id); return orcidId; } }
org.orcid.jaxb.model.v3.rc2.common.Source source = new org.orcid.jaxb.model.v3.rc2.common.Source(); if(OrcidStringUtils.isClientId(this.getSource())) { source.setSourceClientId(new SourceClientId(this.getSource())); } else {
org.orcid.jaxb.model.v3.rc2.common.Source source = new org.orcid.jaxb.model.v3.rc2.common.Source(); if(OrcidStringUtils.isClientId(this.getSource())) { source.setSourceClientId(new SourceClientId(this.getSource())); } else {