Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating the getting started docs #272

Merged
merged 4 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -148,22 +148,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.