Package org.glassfish.jersey.client.oauth2

Examples of org.glassfish.jersey.client.oauth2.OAuth2CodeGrantFlow.start()


                    .prompt(OAuth2FlowGoogleBuilder.Prompt.CONSENT).build();

            SimpleOAuthService.setFlow(flow);

            // start the flow
            final String googleAuthURI = flow.start();

            // redirect user to Google Authorization URI.
            return Response.seeOther(UriBuilder.fromUri(googleAuthURI).build()).build();
        }
        // We have already an access token. Query the data from Google API.
View Full Code Here


                .refreshTokenUri(refreshTokenUri)
                .property(OAuth2CodeGrantFlow.Phase.AUTHORIZATION, "readOnly", "true")
                .property(OAuth2CodeGrantFlow.Phase.AUTHORIZATION, OAuth2Parameters.STATE, state)
                .scope("contact")
                .build();
        final String finalAuthorizationUri = flow.start();

        final Response response = ClientBuilder.newClient().target(finalAuthorizationUri).request().get();
        assertEquals(200, response.getStatus());

        final String code = response.readEntity(String.class);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.