Closed 274188A closed 4 years ago
Hi @274188A
You should follow the instructions included in README:
https://github.com/kgrzybek/modular-monolith-with-ddd#5-how-to-run
There are detailed description how to obtain the token :)
Hi. Following the instructions in README, which is taken from identityserver docs:
POST /connect/token HTTP/1.1
Host: localhost:5000
grant_type=password
&username=testMember@mail.com
&password=testMemberPass
&client_id=ro.client
&client_secret=secret
I keep getting
{
"error": "invalid_request"
}
I find the simplest way to get the token is with Powershell:
$ids_host = "http://localhost:5000"
$connect_token_endpoint = "$ids_host/connect/token"
$response = (curl.exe -d "grant_type=password&username=$login&password=$password&client_id=ro.client&client_secret=secret" $connect_token_endpoint) | Out-String
$json = $response | ConvertFrom-Json
$access_token = $($json.access_token)
Hope that helps. I think curl does a POST by default.
Issue for me was incorrect database connection string. After checking logs/fixing connection string, making Form request gave the correct response. If you are using Insomnia for API client:
I'm fairly new to token tech but I have tried to use Postman to send a POST with simply query strings to get an OAuth2 token (below) using the method shown here.
I'm seeing this error in postman console log:
I think I'm missing something - but is there an
endpoint
for doing Auth?I have used
/oauth/token
but probably not correct but best guesshttps://localhost:5000/oauth/token/?grant_type=password&username=testMember@mail.com&password=testMemberPass&client_id=ro.client&client_secret=secret
I'm happy to help write up/clarify some baby steps if needed :-)