Skip to content

fagneracr/testgraphql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graphqt Sample

API graphql test with mongodb, and JWT auth.

TODO

configure a kb8 machine with mongo.

Auth

To authenticate you need firt use the <base_uri>/api/register (POST), with the body below:

{
    "username": "<your user name>",
    "password": "<your password>"
}

The response (OK) must be:

{
    "message": "registration success"
}

After that you must have a token to access anothers paths, to get a token valid for 1 hour use: <base_uri>/api/login (GET), with the body below:

{
    "username": "<your user name>",
    "password": "<your password>"
}

The response (OK) must be:

{
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRob3JpemVkIjp0cnVlLCJleHAiOjE2NzQ2NjA5MjYsInVzZXJfaWQiOiI2M2QxMzE1ZTAwMmRlOTQ0ODA4YjJjZWMifQ.x9YqKrjR6fslVXaHbq7V8CLV37p5Sp07unVVmDxUvEk"
}

This token can be used like a querystring ?token= or in Header Authorization: bearer

About

API graphql test with mongodb

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published