Skip to content

Commit

Permalink
feat: documentation for imgur (#977)
Browse files Browse the repository at this point in the history
  • Loading branch information
faizplus authored May 24, 2024
1 parent b551e9a commit 3ea0060
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ These providers implement the OAuth2 spec, but are not OpenID providers, which m
- [Strava](https://developers.strava.com/docs/authentication) ([Example configuration](./docs/config-examples/strava.md))
- [Spotify](https://developer.spotify.com/documentation/general/guides/authorization-guide/) ([Example configuration](./docs/config-examples/spotify.md))
- [Unsplash](https://unsplash.com/documentation) ([Example configuration](./docs/config-examples/unsplash.md))
- [Imgur](https://apidocs.imgur.com) ([Example configuration](./docs/config-examples/imgur.md))

## Why you may want to use this library

Expand Down
24 changes: 24 additions & 0 deletions docs/config-examples/imgur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Imgur

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.

Please note:

* Imgur does not provide a OIDC discovery endpoint, so `serviceConfiguration` is used instead.

```js
// your configuration should look something like this
const config = {
issuer: 'https://api.imgur.com/oauth2/',
clientId: 'abc79a5abcdb30e', // your client id
redirectUrl: encodeURIComponent('com.myapp://oauth/callback'), // must wrap it in encodeURIComponent
scopes: [],
serviceConfiguration: {
authorizationEndpoint: 'https://api.imgur.com/oauth2/authorize',
tokenEndpoint: 'https://api.imgur.com/oauth2/token',
},
};

// Log in to get an authentication token
const authState = await authorize(config);
```

0 comments on commit 3ea0060

Please sign in to comment.