@rschil95 hey, i suggest build the calls for Auth2 your self, dont rely on API connect OAuth2 user-agent flow. user-agent flow ask alot of things not necessary.

this way you will have more granualr control on the flow. its very easy.

  • Create the auth URL and send user to that URL like below:

  • this url also need a return url, which send your user back with a code, create a empty page on which you redirect your user.

  • Once your user get redirected to that page. it will have a parameter with code: key you need this key to generate a API token which you can use on other calls.

  • For that you need to build another api call , which you can trigger here once user is redirected to this page , to exchane the code with a API token.

  • this call with return you an acces token. which you can use in you api calls for other end point.

  • That set, save the access_token securly and use it.

Most Auth support anther parameter as STATE whcih is an optional value you can ask the auth provider to send. this way you can use different auth provider in same page to run different exhance call if you are redirecting multiple auth provider in same page. i do this a lot. i.e ( ask fb to send in state facebook , and google to send google. this way once page is loaded i know which exchange call i need to call.