Hi
I am trying to implement ORY Hydra into my project security flow.
The project consists of a client making requests to an API, and I want to increase the security by including an access token with every request to that API and validating the tokens through the Hydra token introspection endpoint.
The difficult part for me is getting ORY Hydra to issue authorization tokens, and I have a few questions.
First of all - I’ve been testing to see if backend-to-backend OAuth with Hydra is even a possibility. I’ve tried this by sending requests to the respective /oauth2/auth/* endpoints and parsing the responses.
- is there a better way of going about implementing this? Sending these “pseudo”-requests seems rudimentary…
- can the “subject” in /oauth2/auth/requests/login/accept endpoint be a string generated by the client who is trying to get the authorization code from Hydra?
- after sending a request to /oauth2/auth/requests/consent/accept endpoint, I get a “redirect_to” link in the response body. By sending another GET request to that url (/oauth2/auth?client_id=xxxxx&consent_verifier=xxxxx&response_type=code&scope=offline&state=xxxxx), I expect to get the authorization code, but I don’t…
Looking at Hydra logs, there doesn’t seem to be anything wrong with the request:
hydra_1 | time=“2019-11-21T14:36:01Z” level=info msg=“started handling request” method=GET remote=“172.20.0.1:34300” request="/oauth2/auth?client_id=auth123&response_type=code&scope=offline&redirect_uri=http://localhost:5555/callback&consent_verifier=d39f7c1e713940fb964ea6e2031a0a69&state=123456789"
hydra_1 | time=“2019-11-21T14:36:01Z” level=info msg=“completed handling request” measure#hydra/public: http://127.0.0.1:4444/.latency=16166800 method=GET remote=“172.20.0.1:34300” request="/oauth2/auth?client_id=xxxxx&response_type=code&scope=offline&redirect_uri=http://localhost:5555/callback&consent_verifier=xxxxx&state=xxxxx" status=302 text_status=Found took=16.1668ms
The Postman response does not give any information either:
Could not get any response
There was an error connecting to /oauth2/auth?client_id=xxxxx&response_type=code&scope=offline&redirect_uri=http://localhost:5555/callback&consent_verifier=xxxxx&state=xxxxx.
Any answers to my questions are greatly appreciated.