Hello everyone!
I was faced with the need to somehow authenticate users not only through the redirect mechanism, but also using the API (primarily needed for testing). Maybe you can tell how to implement this similar scheme.
Hello everyone!
I was faced with the need to somehow authenticate users not only through the redirect mechanism, but also using the API (primarily needed for testing). Maybe you can tell how to implement this similar scheme.
Not sure how that would work? Currently, OAuth2 is the only mechanism to get access tokens.
I mean that users can authenticate by Oauth2, testers and developers can be authenticate by API (will go through the same stage of checks, only without a redirect to the frontend with form login )
the problem is that you need two ways for authentication, roughly speaking, through Postman and through the Web
If i settinng up that authenticate will be as first redirect into frontend (with form login) that not working for Postman,
I have stack ory hydra, ory oathkeeper. I write self provider auth, with implement login-consent flow. But, frontend page with auth form placed in another app with main frontend. I think my flow not working, because need implement login page in provider auth where i can understand how i can authenticate and in this case i will have only one needed redirect to oidc =)
maybe u can get me best practice for this case?
You can only use OAuth2 with Hydra, it does not implement any bespoke/closed source flows. Postman does support OAuth2 iirc. You can not disable the redirection in OAuth2!
yes, but if redirects will be preparing in oidc provider which i writed, i can create flow for authenticate from POSTMAN and any other programms like postman. That’s no mean that i broke oath2 redirects, i decide using auth from postman like:
Hi Kubitre,
I have a similar issue, did you find a way to solve this problem?
i’m wondering how you create the coockie oauth2_consent_csrf and oauth2_authentication_csrf because i added these coockies by myself in client side but always encounter the issue “ The CSRF value from the token does not match the CSRF value from the data store ”. i presume hydra store the coockie value somewhere so it works fine with browser . Do you have any idea or could you please share some of your experience :)? Thank you!
Hi SimonWangJY,
I solve this problem by added some logic in my login-consent provider. If request call by browser it works by redirects into my login-consen provider.
In my case it works for browser by:
Case for POSTMAN like authenticate:
Solution for working with POSTMAN and anything else http clients IT’S only for DEVELOP MODE. This case not used for real production in my company.
thank you very much for your information and it inspires me a lot. Because in our project we wish to get the token from an api by user credential for develop mode, this is what i did:
The reason i separate two apis is because i cannot pass the login credential like user name and password to the login provider without open the browser. Cheers