public ServiceProviderToken put(ServiceProviderToken token) throws StoreException { return store.put(token); }
@PUT @Path("service-provider/{applinkId}/{username}") public Response createServiceProviderAccessToken(@PathParam("applinkId") String applinkId, @PathParam("username") String username) throws TypeNotInstalledException { ServiceProviderToken accessToken = ServiceProviderToken.newAccessToken(getRandomToken()) .tokenSecret(getRandomToken()) .authorizedBy(userManager.resolve(username)) .consumer(getConsumerForApplink(new ApplicationId(applinkId))) .version(ServiceProviderToken.Version.V_1_0) .build(); serviceProviderTokenStore.put(accessToken); return Response.created(URI.create("")) .entity(new RestAccessToken(accessToken)) .build(); }
public void process(HttpServletRequest request, HttpServletResponse response, ServiceProviderToken token) throws IOException { ServiceProviderToken newToken; if (request.getParameter("approve") != null) { String verifier = randomizer.randomAlphanumericString(AuthorizeServlet.VERIFIER_LENGTH); newToken = token.authorize(getLoggedInUser(request), verifier); } else if (request.getParameter("deny") != null) { newToken = token.deny(getLoggedInUser(request)); } else { renderer.render(request, response, token); return; } redirectBackToConsumer(request, response, store.put(newToken)); }
throw ope; Token token = tokenStore.put(factory.generateRequestToken(consumer, callback, message, version));
accessToken = tokenStore.put(factory.generateAccessToken(token)); tokenStore.removeAndNotify(token.getToken()); } catch (Exception e) {
.version(Version.V_1_0_A) .build(); store.put(nonAuthorizedRequestTokenForAuthorizing); .version(Version.V_1_0_A) .build(); store.put(nonAuthorizedRequestTokenForDenying); .version(Version.V_1_0_A) .build(); store.put(spareNonAuthorizedRequestToken); .version(Version.V_1_0_A) .build(); store.put(nonAuthorizedRequestTokenWithoutCallbackForAuthorizing); .version(Version.V_1_0_A) .build(); store.put(nonAuthorizedRequestTokenWithoutCallbackForDenying); .version(Version.V_1_0_A) .build(); store.put(authorizedRequestTokenForSwapping); .version(Version.V_1_0_A) .build(); store.put(spareAuthorizedRequestToken); }})