oltu-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Saqib Ali <saqib.n....@seagate.com>
Subject Re: Google OpenID Connect Authentication example
Date Wed, 25 Mar 2015 00:38:21 GMT
Ashwanth,

I added  .setParameter("access_type", "offline") to the original
Authorization request, and the Refresh Token came back with the Access
Token :)

Another question: How do you get the OpenID 2.0 identifier (openid_id)
using Oltu?

Thanks! :)


------
Saqib
https://twitter.com/secure_UX

On Tue, Mar 24, 2015 at 7:28 AM, Tiburtius, Ashwanth [IWD] <
Ashwanth.Tiburtius@iwd.iowa.gov> wrote:

> Hi Saqib,
>
>
>
> I have not tried that. I am sure that there is a way. Will let you know if
> I figure it out. One place to look at would be the archives in the user
> group. You might find some help there. Sorry I couldn’t be of much help
> here.
>
>
>
> Regards,
>
> Jude.
>
> Iowa Workforce Development – IT | 1000 E Grand Ave, Des Moines, IA  50319
>
> (515) 281-3378 | Ashwanth.Tiburtius@iwd.iowa.gov
>
>
>
> *From:* Saqib Ali [mailto:saqib.n.ali@seagate.com]
> *Sent:* Monday, March 23, 2015 5:44 PM
>
> *To:* user@oltu.apache.org
> *Subject:* Re: Google OpenID Connect Authentication example
>
>
>
> Ashwanth,
>
>
>
> In your example, how do you retrieve the Refresh Token?
>
>
>
> Thanks for all the help on this! :)
>
>
>
> Saqib
>
>
>
> On Fri, Mar 20, 2015 at 3:43 PM, Tiburtius, Ashwanth [IWD] <
> Ashwanth.Tiburtius@iwd.iowa.gov> wrote:
>
> It is - https://www.googleapis.com/oauth2/v2/userinfo
>
>
>
> Regards,
>
> Jude.
>
> Iowa Workforce Development – IT | 1000 E Grand Ave, Des Moines, IA  50319
>
> (515) 281-3378 | Ashwanth.Tiburtius@iwd.iowa.gov
>
>
>
> *From:* Saqib Ali [mailto:saqib.n.ali@seagate.com]
> *Sent:* Friday, March 20, 2015 5:41 PM
>
>
> *To:* user@oltu.apache.org
> *Subject:* Re: Google OpenID Connect Authentication example
>
>
>
> Ashwanth,
>
>
>
> In your code sample, what is the value for the Constants.G_USERINFO_URL?
>
>
>
> Thanks! :)
>
>
>
> On Fri, Mar 20, 2015 at 10:13 AM, Tiburtius, Ashwanth [IWD] <
> Ashwanth.Tiburtius@iwd.iowa.gov> wrote:
>
> Hi Saqib,
>
>
>
> It is mentioned in the Oltu documentation. All that I have is
>
>
>
>               <dependency>
>
>                      <groupId>org.apache.oltu.oauth2</groupId>
>
>                      <artifactId>org.apache.oltu.oauth2.client</artifactId
> >
>
>                      <version>1.0</version>
>
>               </dependency>
>
>
>
> Regards,
>
> Jude.
>
> Iowa Workforce Development – IT | 1000 E Grand Ave, Des Moines, IA  50319
>
> (515) 281-3378 | Ashwanth.Tiburtius@iwd.iowa.gov
>
>
>
> *From:* Saqib Ali [mailto:saqib.n.ali@seagate.com]
> *Sent:* Friday, March 20, 2015 11:23 AM
> *To:* user@oltu.apache.org
> *Subject:* Re: Google OpenID Connect Authentication example
>
>
>
>  Ashwanth,
>
>
>
> Thanks for the response. Can you please tell me what maven artifacts and
> imports I need to use to run this code?
>
>
>
> Thanks! :)
>
>
>
> On Tue, Mar 17, 2015 at 8:53 AM, Tiburtius, Ashwanth [IWD] <
> Ashwanth.Tiburtius@iwd.iowa.gov> wrote:
>
> Hi Saqib,
>
>
>
> See if this helps:
>
>
>
> Build request to redirect to Google.
>
>
>
> OAuthClientRequest request =
> OAuthClientRequest.authorizationProvider(OAuthProviderType.*GOOGLE*)
>
>                                                 .setClientId(Constants.
> *G_CLIENT_ID*
>
>                                                 .setResponseType(OAuth.
> *OAUTH_CODE*)
>
>                                                 .setScope(Constants.
> *G_SCOPE*)
>
>                                                 .setRedirectURI(Constants.
> *OAUTH_REDIRECT_URL*)
>
>                                                 buildQueryMessage();
>
>
>
> Redirect to request.getLocationUri()
>
>
>
> Get the auth code returned from Google after user signs in.
>
> Get access token using the following.
>
> OAuthClientRequest oAuthClientRequest = OAuthClientRequest.*tokenProvider*
> (OAuthProviderType.*GOOGLE*)
>
>
> .setGrantType(GrantType.*AUTHORIZATION_CODE*)
>
>
> .setClientId(Constants.*G_CLIENT_ID*)
>
>
> .setClientSecret(Constants.*G_CLIENT_SECRET*)
>
>
> .setRedirectURI(Constants.*OAUTH_REDIRECT_URL*)
>
>
> .setCode(*this*.code).buildBodyMessage();
>
>
>
> *final* OAuthAccessTokenResponse accessTokenResponse = oAuthClient
> .accessToken(oAuthClientRequest);
>
> accessToken = accessTokenResponse.getAccessToken();
>
>
>
> Get User info using the following.
>
>
> *final* OAuthClientRequest bearerClientRequest = *new*
> OAuthBearerClientRequest(Constants.*G_USERINFO_URL*)
>
>
> .setAccessToken(accessToken)
>
>
> .buildHeaderMessage();
>
>
>
> OAuthResourceResponse resourceResponse = oAuthClient.resource(
> bearerClientRequest,
>
> OAuth.HttpMethod.*GET*, OAuthResourceResponse.*class*);
>
> resourceResponse.getBody()
>
>
>
>
>
> Regards,
>
> Jude.
>
> Iowa Workforce Development – IT | 1000 E Grand Ave, Des Moines, IA  50319
>
> (515) 281-3378 | Ashwanth.Tiburtius@iwd.iowa.gov
>
>
>
> *From:* Saqib Ali [mailto:saqib.n.ali@seagate.com]
> *Sent:* Monday, March 16, 2015 8:20 PM
> *To:* user@oltu.apache.org
> *Subject:* Google OpenID Connect Authentication example
>
>
>
> Greetings,
>
>
>
> Can anyone please send me a Google OpenID Connect Authentication example
> using the Oltu Open Connect library?
>
>
>
> Thanks! :)
>
>
>
>
>
>
>

Mime
View raw message