User auth
Login
POST: {URL}/auth/realms/{realm_id}/protocol/openid-connect/token
Body type: "x-www-form-urlencoded"
"grand_type:password & username:test@test.com & password:test & redirect_uri:http://tyk:3000/auth/oid"
RESPONSE
{
"access_token": "...",
"expired_in": "...",
"refresh_expires_in": "...",
"refresh_token": "...",
"token_type": "...",
"not-before-policy": "...",
"session_state":"...",
"scope": "..."
}
Register
POST: {URL}/auth/admin/{realm_id}/users
auth: "Authorization": "Bearer ey...." (ADMIN TOKEN)
body = {
"email": "test@test.com",
"username": "test_username",
"enabled": true,
"credentials": [
{
"type":"password",
"value": "test",
"temporary": false
}
],
"clientRoles":{
"{client_id}":{
"{role_id}"
}
}
}
RESPONSE
code 201
the users by default are created as basic user