Re: Send extra parameters to the OAuth server

835 views
Skip to first unread message

Greg Robbins

unread,
Mar 22, 2013, 4:26:26 PM3/22/13
to gtm-o...@googlegroups.com
I need to pass the client name as a parameter to the request

I do not understand the context of your question. There is not a "client name" in the OAuth 2 protocol, nor do I know what request is being referenced. Is this related to use of gtm-oauth2?

Greg Robbins

unread,
Mar 22, 2013, 10:25:44 PM3/22/13
to gtm-o...@googlegroups.com
The GTMOAuth2SignIn object has a property additionalAuthorizationParameters for any additional parameters for the initial web request. 

The GTMOAuth2Authentication object has properties additionalTokenRequestParameters and additionalGrantTypeRequestParameters for adding parameters to the token exchange.

Hopefully one of those can fulfill the requirement of your auth server.

Jeremy Wiebe

unread,
Jul 12, 2013, 7:05:51 PM7/12/13
to gtm-o...@googlegroups.com
I had the same issue (using LinkedIn's OAuth2 implementation which requires a custom 'state' parameter in the initial authorization view URL).

I was able to set the additionalAuthorizationParameters by subclassing GTMOAuth2SignIn, setting the parameters in the init, and then telling GTMOAuth2ViewControllerTouch that my custom SignIn class is the signInClass:

  GTMOAuth2ViewControllerTouch.signInClass = [MyCustomSignIn class];

I'm wondering, is there a simpler way to do this?  It doesn't appear that when pushing GTMOAuth2ViewControllerTouch into a UINavigationController that there's any way to set those parameters as they are an instance variable on a class that is created by GTMOAuth2ViewControllerTouch.

romangm

unread,
Aug 30, 2013, 11:29:24 AM8/30/13
to gtm-o...@googlegroups.com
Had this same issue. 

You can add "additionalAuthorizationParameters" to the GTMOAuth2ViewControllerTouch public signin property:

    GTMOAuth2ViewControllerTouch *viewController;
    viewController = [GTMOAuth2ViewControllerTouch controllerWithAuthentication:auth
                                                               authorizationURL:authURL
                                                               keychainItemName:keychainItemName
                                                                       delegate:self
                                                               finishedSelector:sel];

    NSDictionary *additionalParams = [[NSDictionary alloc] initWithObjectsAndKeys:@"myValue", @"myKey", nil];
    viewController.signIn.additionalAuthorizationParameters = additionalParams;

Bhavesh Kakadiya

unread,
Sep 28, 2015, 10:34:23 AM9/28/15
to GTM OAuth 2 Discussion
Hi

This signIn is no longer there in viewController in latest build, does anyone know how can i set those additional params.
Reply all
Reply to author
Forward
0 new messages