Hello, everyone.
I’m trying to create a golang cli to interact with the API. I managed to do this authenticating with an API Token provided by the user, stored in a file or in an envvar.
Now I am trying to add oauth2 access, the goal is:
- when the user runs the script it opens a browser with the okta login and creates an http server behind the scenes to catch the redirect.
- the user logs in
- the server catches the data and extracts the id and access tokens and the JSESSIONID
- the server is shutdown
- and the script uses the data to call the sdk
So far I am getting the credentials, but I can’t figure out how to create the new sdk client with them (I mean, create the client with an API token is easy, but how can I pass to it the id and access tokens and the JSESSIONID?)
Using these:
"github.com/okta/okta-sdk-golang/v2/okta"
"github.com/okta/okta-sdk-golang/v2/okta/query"
"github.com/okta/okta-jwt-verifier-golang"
Any suggestions?
Thanks