def get_metadata(payload)
      auth_server_id    = payload['iss'].split('/').last # iss: "https://<org>.oktapreview.com/oauth2/<auth_server_id>"
      client_id         = payload['cid']
      metadata_response = client(payload['iss']).get do |req|
        req.url "/oauth2/#{auth_server_id}/.well-known/oauth-authorization-server?client_id=#{client_id}"
      end
      JSON.parse(metadata_response.body)
    end
def get_metadata(payload)
      auth_server_id    = payload['iss'].split('/').last # iss: "https://<org>.oktapreview.com/oauth2/<auth_server_id>"
      client_id         = payload['cid']
      metadata_response = client(payload['iss']).get do |req|
        req.url "/oauth2/#{auth_server_id}/.well-known/oauth-authorization-server?client_id=#{client_id}"
      end
      JSON.parse(metadata_response.body)
    end
fetch client metadata using cid/aud