I have oAuth2.0 setup but requesting token asks to login

Inkal.N.388 Posts: 2 🔍
I'm trying to connect to API from c# code, I can request token through postman, but the request only works when I'm logged in;otherwise, it asks me to login and then I can retrieve the token by clicking on 'Get new access token'. This might work when I'm testing but when I'm trying to request token from c# code based on clientID and secret, it won't work. How do I bypass login screen?


  • Derik.P.149
    Derik.P.149 Posts: 16 🧭

    You can't bypass the login screen (at least initially). You'll need to provide authorization from a user account in order for the application to work.

    You can, however, retain the refresh token. According to D2L support, refresh tokens last for 30 days. Exchange your refresh token for a new refresh token and access token every time your existing access token expires. Make sure you save the new refresh token every time, since they're only good for one exchange.

    This strategy does require you to "kick-start" the application with either an authorization code or refresh token, so there is still a requirement to do the initial login step.