A
A
Argenon2016-03-22 09:24:50
OAuth
Argenon, 2016-03-22 09:24:50

How to use Oauth authorization in ADFS?

I have a web application whose users can access it via Oauth. There is a server with WinServ2012 r2.
Raised the role of ADFS (as I understand it, Oauth is already included). I can't find any documentation on this topic. I would like to be able to use user accounts in Active Directory for authorization in a web application.
I found examples of use, but I don’t catch up with something how to implement it. For example:

Getting the authorization_code:
youradfsserver/adfs/oauth2/authorize?response_type=code&client_id=YourRegisteredClientId&redirect_uri=YourRedirectUri&resource=yourrelayingpartyId

What should I specify as clientId if I want to use users from AD, where should I redirect the user, what resource should I specify...?
I read Microsoft's help, it says about integration with the catalog. But in practice, it didn’t work out, as I understand it will only be in the next version, I don’t know if this is really true. Please point me to the right path.
UPD
I figured it out, got access to the authorization page, entered the login and password of the domain user and received the authorization code, it remains to get the token.
Sending a POST request
asdf.domain.ru/adfs/oauth2/token?grant_type=authorization_code&client_id=01&redirect_uri= https://localhost/auth&code=U2dIhBsRt0eDn....
and an error occurs
"There are no registered protocol handlers on path /adfs/oauth2/token to process the incoming request"
I'm posting with postman.
UPD2 Understood
with postman. Wrote the parameters in the wrong place. Now another problem, returns an error:
{
"error": "invalid_grant",
"error_description": "MSIS9612: The authorization code received in 'code' parameter is invalid. "
}

I pass the code from the response of the first request. What could be the problem...?
UPD3
But no, everything worked out, just the hands are crooked.
Thanks to everyone who took part in the discussion

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Bogryashov, 2018-02-05
@vitalybogryashov

If someone repeats this, please make an instruction and share a link to the blog/forum/document.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question