Skip to content

Commit 3ea0060

Browse files
authored
feat: documentation for imgur (#977)
1 parent b551e9a commit 3ea0060

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ These providers implement the OAuth2 spec, but are not OpenID providers, which m
5151
- [Strava](https://developers.strava.com/docs/authentication) ([Example configuration](./docs/config-examples/strava.md))
5252
- [Spotify](https://developer.spotify.com/documentation/general/guides/authorization-guide/) ([Example configuration](./docs/config-examples/spotify.md))
5353
- [Unsplash](https://unsplash.com/documentation) ([Example configuration](./docs/config-examples/unsplash.md))
54+
- [Imgur](https://apidocs.imgur.com) ([Example configuration](./docs/config-examples/imgur.md))
5455

5556
## Why you may want to use this library
5657

docs/config-examples/imgur.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Imgur
2+
3+
Imgur provides an OAuth 2.0 endpoint for logging in with a Imgur user's credentials. You'll need to first [register your Imgur application here](https://api.imgur.com/oauth2/addclient). See [this comment](https://github.com/FormidableLabs/react-native-app-auth/issues/516#issuecomment-2115465572) for detailed setup guide.
4+
5+
Please note:
6+
7+
* Imgur does not provide a OIDC discovery endpoint, so `serviceConfiguration` is used instead.
8+
9+
```js
10+
// your configuration should look something like this
11+
const config = {
12+
issuer: 'https://api.imgur.com/oauth2/',
13+
clientId: 'abc79a5abcdb30e', // your client id
14+
redirectUrl: encodeURIComponent('com.myapp://oauth/callback'), // must wrap it in encodeURIComponent
15+
scopes: [],
16+
serviceConfiguration: {
17+
authorizationEndpoint: 'https://api.imgur.com/oauth2/authorize',
18+
tokenEndpoint: 'https://api.imgur.com/oauth2/token',
19+
},
20+
};
21+
22+
// Log in to get an authentication token
23+
const authState = await authorize(config);
24+
```

0 commit comments

Comments
 (0)