diff options
author | John Nduli | 2024-08-19 18:29:38 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-08-19 12:15:18 -0500 |
commit | 9b52f1a65af80d75e8e85bdc2cf9e8c9924e2359 (patch) | |
tree | afa411bbde59476ca21fd26cbee87d4d15dc6aa5 /topics | |
parent | 99f560d5ab9b801e8b94ef139b65d17f8d46d5ac (diff) | |
download | gn-gemtext-9b52f1a65af80d75e8e85bdc2cf9e8c9924e2359.tar.gz |
docs: add FAQ for common questions
Diffstat (limited to 'topics')
-rw-r--r-- | topics/authentication/development-guide.gmi | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/topics/authentication/development-guide.gmi b/topics/authentication/development-guide.gmi new file mode 100644 index 0000000..3c6e4ea --- /dev/null +++ b/topics/authentication/development-guide.gmi @@ -0,0 +1,49 @@ +# FAQs + +## 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. |