Skip to content

Commit 958da4c

Browse files
committed
Updated google setup instructions and fixed github with url
1 parent e90ed3b commit 958da4c

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ To add Google auth to our application, first we'll need to create a google appli
285285

286286
We need to enable the `Identity Toolkit API` API. Click on `Enable API` and add this api to your app. Once it's enabled, we'll need to collect our credentials.
287287

288-
Navigate to the `Credentials` tab and create a new credential. Create a **web API credential**. Take note of the client id and the URL scheme. In addition, make sure to set the bundle ID as the bundle id in our application in Xcode:
288+
Navigate to the `Credentials` tab and create a new credential. Create an **iOS API credential**. Take note of the `client_id` and the `iOS URL scheme`. In addition, make sure to set the bundle ID as the bundle id in our application in Xcode:
289289

290290
![](./resources/google/creds.png)
291291

@@ -299,8 +299,7 @@ Finally, add the `client_id` credential as the id from the url page as well as t
299299
const config = {
300300
google: {
301301
callback_url: `[IOS SCHEME]:/google`,
302-
client_id: 'YOUR_CLIENT_ID',
303-
client_secret: 'YOUR_CLIENT_SECRET'
302+
client_id: 'YOUR_CLIENT_ID'
304303
}
305304
}
306305
```

ios/OAuthManager/OAuthManager.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,6 @@ - (NSDictionary *) dictionaryForCredentialKeys:(NSObject *) credential
551551
} else {
552552
id value = [credential valueForKey:key];
553553

554-
NSLog(@"key: %@ = %@", key, value);
555554
if (value == nil) {
556555

557556
} else if ([value isKindOfClass:[NSNumber class]]

lib/authProviders.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export const authProviders = {
5656
auth_version: '2.0',
5757
authorize_url: 'https://github.com/login/oauth/authorize',
5858
access_token_url: 'https://github.com/login/oauth/access_token',
59+
api_url: 'https://api.github.com',
5960
callback_url: ({app_name}) => `${app_name}://oauth`,
6061
validate: validate()
6162
}

react-native-oauth.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,14 @@ export default class OAuthManager {
107107
invariant(OAuthManager.isSupported(name), `The provider ${name} is not supported yet`);
108108

109109
const providerCfg = Object.assign({}, authProviders[name]);
110-
let { validate = identity, transform = identity, callback_url } = providerCfg;
110+
let { validate = identity, transform = identity, callback_url, api_url } = providerCfg;
111111
delete providerCfg.transform;
112112
delete providerCfg.validate;
113113

114114
let config = Object.assign({}, {
115115
app_name: this.appName,
116-
callback_url
116+
callback_url,
117+
api_url
117118
}, providerCfg, props);
118119

119120
config = Object.keys(config)
@@ -123,6 +124,7 @@ export default class OAuthManager {
123124
}), {});
124125

125126
validate(config);
127+
126128
return promisify('configureProvider')(name, config);
127129
}
128130

resources/google/creds.png

-249 KB
Loading

0 commit comments

Comments
 (0)