Get authorization code programatically before acquiring token?

82 views Asked by At

I have a .NET API and a React SPA. When users want to sign in, they are redirected to AD FS. After signing in, they are redirected back to the SPA with the auth code, which is then sent to the .NET API to redeem it for a token. The API also uses a client secret with the request for the token.

This works fine, but I have integration tests that are tricky to setup. Currently using selenium with Chrome to automate being sent to AD FS SSO page, and programatically logging in with username and password. I'd really like to avoid this and make it simpler.

Can I somehow make the request to get only the auth code from AD? Can't seem to find anything in MSAL .NET. I see there is a lot "AcquireToken" methods, but no acquire auth code. Is this perhaps not possible?

0

There are 0 answers