I ran into the issue where I have multiple authorization servers in Okta and did not use the default authorization server.
OmniAuth::Strategies::Okta hard codes the userinfo endpoint to the default authorization server. Additionally, it tries to use the base URL authorization server to decode the JWT, as well as determine the audience (e.g. http://my-okta-url/oauth2/v1 as opposed to http://my-okta-url/oauth2/<custom or default>/v1. The default audience is api://default.)
Proposal
Add some configuration to allow us to support more than just the default authorization server, and also remove any kind of hard-coded endpoints.
Problem
I ran into the issue where I have multiple authorization servers in Okta and did not use the
default
authorization server.OmniAuth::Strategies::Okta
hard codes theuserinfo
endpoint to thedefault
authorization server. Additionally, it tries to use the base URL authorization server to decode the JWT, as well as determine the audience (e.g.http://my-okta-url/oauth2/v1
as opposed tohttp://my-okta-url/oauth2/<custom or default>/v1
. The default audience isapi://default
.)Proposal
Add some configuration to allow us to support more than just the
default
authorization server, and also remove any kind of hard-coded endpoints.