Skip to content

Instantly share code, notes, and snippets.

@yuikns
Created August 25, 2014 12:41
Show Gist options
  • Save yuikns/cee53d4a66f6346c498b to your computer and use it in GitHub Desktop.
Save yuikns/cee53d4a66f6346c498b to your computer and use it in GitHub Desktop.
## use sense
enroll :
POST /auth/enroll
{
"name" : "yu",
"email" : "[email protected]",
"dname" : "Yu Jing",
"password" : "123456",
"title" : "nothing ",
"role" : 0 ,
"address" : "tsinghua"
}
authenticate :
POST /auth
{
"username": "yu",
"password": "123456"
}
## use curl , visit protected data
curl localhost:5000/ums/jwt/123/ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsImV4cCI6MTQwODk1NjEwMCwiaWF0IjoxNDA4OTU1ODAwfQ.eyJ1c2VyX2lkIjoiNTNmYWVlODE5OWI3NTdlODljZGFkN2M3In0.f5f549Q2rR04mSWvyextLSrzGXjmWtBc01Lm41jR8XQ"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment