okta / okta-auth-js

The official js wrapper around Okta's auth API
Other
453 stars 265 forks source link

getRequestContext() method not returning custom properties from OpenId Clients #1241

Open brentlyjdavid opened 2 years ago

brentlyjdavid commented 2 years ago

Describe the bug?

When we use the OpenIdConnect Events in an MVC Client, we add custom parameters to the request using the event. The /authorize endpoint has the items in the URL, but that URL gets hidden in the okta hosted login page.

When calling OktaUtil.getRequestContext(); the items do not show up from our original request.

What is expected to happen?

I expect that all custom properties entered on the event to be available using the getRequestContext() method on the widget.

What is the actual behavior?

No properties show up

Reproduction Steps?

Use MVC sample, add custom property to OnRedirectToIdentityProvider event. Then after Okta hosted page loads, do the getReqeustContext() method and see no properties show up in the JSON response.

SDK Versions

Widget version based on sources tab: 6.3.2 on Okta Hosted Login Page.

Execution Environment

Okta Hosted Widget - JS

Additional Information?

REF Issue on MVC SDK for more details Here

brentlyjdavid commented 2 years ago

Authorize request Sample, it contains the custom property of 'productId' as we need. but once the page loads, the URL is gone and the getRequestContext() method does not return it for us.

https://{oktaDomain}/oauth2/default/v1/authorize?client_id={clientId}&redirect_uri=https%3A%2F%2Flocalhost%3A44399%2FAuthenticationUserPortal%2Fauthorization-code%2Fcallback&response_type=code&scope=openid%20profile&code_challenge={codeChallenge}&code_challenge_method=S256&response_mode=form_post&nonce={nonce}&productId=1234&state={state}&x-client-SKU=ID_NETSTANDARD2_0&x-client-ver=6.10.0.0

jaredperreault-okta commented 2 years ago

Can you provide a code snippet of your use of OktaUtil.getRequestContext()?

brentlyjdavid commented 2 years ago

Hi @jaredperreault-okta I'm not totally sure what you mean, but we are editing the page from the Customization tab on the hosted page. So i'm just console.logging the .getRequestContext() to figure out where my properties are at.

image

jaredperreault-okta commented 2 years ago

Thanks for this report, we'll look into this internally

Internal Ref: OKTA-511534