blob: 840c26b35518173f8a428622a3b1d157387cc4fd (
about) (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# GN-AUTH FAQ
## Tags
* type: docs, documentation
* status: ongoing, open
* keywords: authentication, authorisation, docs, documentation
* author: @jnduli
## Quick configuration for local development
Save a `local_settings.conf` file that has the contents:
```
SQL_URI = "mysql://user:password@localhost/db_name" # mysql uri
AUTH_DB = "/absolute/path/to/auth.db/" # path to sqlite db file
GN_AUTH_SECRETS = "/absolute/path/to/secrets/secrets.conf"
```
The `GN_AUTH_SECRETS` path has two functions:
* It contains the `SECRET_KEY` we use in our application
* The folder containing this file is used to store our jwks.
An example is:
```
SECRET_KEY = "qQIrgiK29kXZU6v8D09y4uw_sk8I4cqgNZniYUrRoUk"
```
## Quick set up cli commands
```
export FLASK_DEBUG=1 AUTHLIB_INSECURE_TRANSPORT=1 OAUTHLIB_INSECURE_TRANSPORT=1 FLASK_APP=gn_auth/wsgi
export GN_AUTH_CONF=/absolute/path/to/local_settings.conf
flask init-dev-clients --client-uri "http://localhost:port"
flask init-dev-users
flask assign-system-admin 0ad1917c-57da-46dc-b79e-c81c91e5b928
```
## Handling verification for users in local development
* Run flask init_dev_users, which will create a verified local user.
* Run `UPDATE users set verified=1` on the sqlite3 auth database.
## Errors related to unsupported clients/redirect URIs for client
Rerun
```
FLASK_DEBUG=1 AUTHLIB_INSECURE_TRANSPORT=1 OAUTHLIB_INSECURE_TRANSPORT=1 \
GN_AUTH_CONF=/absolute/path/to/local_settings.conf FLASK_APP=gn_auth/wsgi \
flask init-dev-clients --client-uri "http://localhost:port_you_use_for_gn2"
```
This will update your clients list to have all the related urls we want.
## 500 Server Error: INTERNAL SERVER ERROR
When you see the error: `500 Server Error: INTERNAL SERVER ERROR for url: http://localhost:8081/auth/token`, restart the gn2 server.
|