forked from UBAutograding/devU-api
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from emilkovacev/setup-auth-docs
Fetching and using the bearer token
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,50 @@ If you wish to better understand how this works, here's a bit more information. | |
When developer auth is enabled, users can provide the email & externalId of the user they wish to login as (or create) and recieve a valid refresh/ access token. | ||
### Fetching the bearer token | ||
Request: `POST /login/developer` | ||
|
||
Sample Request body: | ||
``` | ||
{ | ||
"email": "[email protected]", | ||
"externalId": "101" | ||
} | ||
``` | ||
|
||
Sample Response: | ||
|
||
``` | ||
{ | ||
"message": "Login successful" | ||
} | ||
``` | ||
|
||
Sample Response Headers: | ||
``` | ||
{ | ||
"Set-Cookie": "refreshToken=<token>;<cookie settings>" | ||
} | ||
``` | ||
|
||
### Using the Bearer token | ||
|
||
Request: `GET /users` | ||
|
||
Request headers (notice the space between `Bearer` and `<token>`!): | ||
|
||
``` | ||
{ | ||
"Authorization": "Bearer <token>" | ||
} | ||
``` | ||
|
||
With this flag on, it enabled the `/login/developer` route (see `./router/login.router.ts` for more details). | ||
|
||
|
||
|
||
## Testing SAML Authentication Locally | ||
|
||
To test SAML authentication, you will need to configure an Identity Provider (IDP) for the API to authenticate against. As we don't expect anyone to just have a configured IDP laying around ready to go, this will walk through using [SamlTest.id](https://samltest.id/). | ||
|