Skip to content
Permalink
Browse files

add error-code page

  • Loading branch information
nguyenkims committed Nov 12, 2019
1 parent c5b24cd commit 65d8dd5fa13ef6dd0f0422f531fc8db47f54bd1f
Showing with 32 additions and 1 deletion.
  1. +8 −1 README.md
  2. +2 −0 content/docs/app.md
  3. +21 −0 content/docs/errors.md
  4. +1 −0 content/menu/index.md
@@ -1,3 +1,10 @@
To deploy:

> hugo && now -n public --prod public
> hugo && now -n public --prod public
To dev locally

> hugo server
Then open http://localhost:1313

@@ -26,6 +26,8 @@ This is the most important field in your app! By default SimpleLogin **whitelist

![](/images/redirect-uri.png)

When some errors happen during the authorization flow, SimpleLogin redirects user back to `redirect_uri?error={error_code}` so your app can act accordingly. Please find the list of all errors on [Error Codes]({{< relref "/docs/errors.md" >}}).

## Libraries/Framework

SimpleLogin has added support for SimpleLogin in the following popular libraries and more are coming:
@@ -0,0 +1,21 @@
# Possible error codes

When some errors happen during the authorization flow, SimpleLogin redirects user back to `redirect_uri?error={error_code}` so your app can act accordingly. Some errors are often caught during development but some can come from the user. Please find below the complete list of errors:

- `deny`: probably the most frequent error. This happens when user denies sharing their info with your app. You can maybe in this case offer another sign-in mechanism to user, or if SimpleLogin is the only one, let user know that they need to accept sharing their data in order to use your app.

- `invalid_client_id`: this happens when the provided `client_id` is unknown or empty. It can happen when the `client_id` is not set correctly in the code. As a reminder, the authorization url has the following format:

```text
https://app.simplelogin.io/oauth2/authorize
?response_type=[code|token]
&client_id=CLIENT_ID
&redirect_uri=REDIRECT_URI
&scope=profile
&state=STATE
```

- `http_not_allowed`: by default, `http[s]://localhost:*` is whitelisted to facilitate development. However once the *Login with SimpleLogin* code hits the production, a correct `redirect_uri` needs to be set on developer page (cf [App]({{< relref "/docs/app.md" >}})). For security reason, `http` is not allowed so you must use `https` for the web. For mobile apps, a custom scheme (e.g. `com.my_company.my_app://`) is also allowed.

- `unknown_redirect_uri`: the `redirect_uri`, if other than `http[s]://localhost:*` needs to be set on developer page. Please see [App]({{< relref "/docs/app.md" >}}).

@@ -11,4 +11,5 @@ headless: true

- [Code Flow - the raw way]({{< relref "/docs/code-flow.md" >}})
- [Implicit Flow - the raw way]({{< relref "/docs/implicit-flow.md" >}})
- [Error Codes]({{< relref "/docs/errors.md" >}})

0 comments on commit 65d8dd5

Please sign in to comment.
You can’t perform that action at this time.