DEV Community

Afshar
Afshar

Posted on

3 1

OAuth CodeFlow without redirection

I wanted to implement OAuth 2 Code Flow with PKCE by help of IdentityServer. Currently, mobile users put their user/password only in the mobile app. They do not redirect to other pages via browsers or popups. When I use Postman to test APIs, I just call some APIs to get access token. I want no major changes on this part too. I do not like a call back endpoint in my side or a popup window in the postman.
Seems that Code Flow cannot be implemented without redirections. In the other hands, the user/pass should be entered in the authentication provider directly. My searches for followings was not helpful:

  • identityserver oauth2 code flow login without redirect
  • identityserver code flow embed login page

A work-around is to embed login page but not sure if it is possible. Postman has an internal mechanism for oauth 2 logging in. It includes entering clientId and client secret then a popup is opened to enter user/pass. However, I was in search of simulating this by several API calls. As my back-end is .Net, I tried to use IdentityServer. I used templates to create a sample application.

Useful resources I found during this search:

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay