Skip to content

Commit

Permalink
Merge pull request #272 from Roseford/updating_docs
Browse files Browse the repository at this point in the history
Updating the getting started docs
  • Loading branch information
robsavoye authored Mar 28, 2023
2 parents e453178 + 6100ac0 commit 0ec79ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions docs/DEV-1.-Getting-Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ The FMTM uses OAUTH2 with OSM to authenticate users. To properly configure your

3. Right now read user preferences permission is enough later on fmtm may need permission to modify the map option which should be updated on OSM_SCOPE variable on .env , Keep read_prefs for now.

4. Now Copy your Client ID and Client Secret. Put them in the `OSM_CLIENT_ID` and `OSM_CLIENT_SECRET` of your `.env` file
4. Now Copy your Client ID and Client Secret. Put them in the `OSM_CLIENT_ID` and `OSM_CLIENT_SECRET` field of your `.env` file

### 2. Create an `.env` File

Expand Down Expand Up @@ -151,22 +151,24 @@ For details on how to run this project locally for development, please look at:

Once you have deployed, you will need to check that you can properly authenticate.

1. Navigate to `API_URL/docs`
1. Navigate to `http://127.0.0.1:8000/docs`

Three endpoints are responsible for oauth
<img width="698" alt="image" src="https://user-images.githubusercontent.com/36752999/216319601-949c4262-782f-4da4-ae26-dac81c141403.png">
<img width="698" alt="image" src="../images/endpoints_responsible_for_auth_screenshot-2023-03-26-092756.png">

2. Hit `/auth/osm_login/` : This will give you the Login URL where you can supply your osm username/password
2. Select the `/auth/osm_login/` endpoint, click `Try it out` and then `Execute`.
This would give you the Login URL where you can supply your osm username and password.

Response should be like this :
Your response should look like this:

{"login_url": "https://www.openstreetmap.org/oauth2/authorize/?response_type=code&client_id=xxxx"}

Now Copy your login_url and hit it in new tab, and you will be redirected to OSM for your LOGIN. Give FMTM the necessary permission
Now copy and paste your login_url in a new tab. You would be redirected to OSM for your LOGIN. Give FMTM the necessary permission.

After successful login, you will get your `access_token` for FMTM Copy it and now you can use it for rest of the endpoints that need authorizations
After a successful login, you will get your `access_token` for FMTM, Copy it. Now, you can use it for rest of the endpoints that needs authorization.

3. Check your access token: Hit `/auth/me/` and pass your `access_token` You should get your osm id, username and profile picture id
3. Check your access token: Select the `/auth/me/` endpoint and click `Try it out`.
Pass in the `access_token` you copied in the previous step into the `access-token` field and click `Execute`. You should get your osm id, username and profile picture id.

# Start Developing

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0ec79ed

Please sign in to comment.