# Can I use the Okta Sign-In Widget, OIDC and normal Okta session functionality?

**URL:** <https://devforum.okta.com/t/can-i-use-the-okta-sign-in-widget-oidc-and-normal-okta-session-functionality/998>\
**Category:** OAuth/OIDC\
**Created:** [January 8, 2018, 12:16am UTC](https://devforum.okta.com/t/can-i-use-the-okta-sign-in-widget-oidc-and-normal-okta-session-functionality/998 "2018-01-08T00:16:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![richard](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@richard](https://devforum.okta.com/u/richard)\
**Post date:** [January 8, 2018, 12:16am UTC](https://devforum.okta.com/t/can-i-use-the-okta-sign-in-widget-oidc-and-normal-okta-session-functionality/998/1 "2018-01-08T00:16:58Z")

</div>

The primary use case is that the widget would be used to get an id\_token and then it would be passed to a downstream app (App A) which would consume it and SSO the user and issue an app session token of their own.

In addition, a link within App A would then trigger an SP-initiated SAML flow to another downstream app (App B). As App B can’t consume an id\_token, we would need to exchange it during initial Okta auth (I would think) for an Okta session cookie. I’m relatively clear on using the [following approach](https://developer.okta.com/code/javascript/okta_auth_sdk) to do so. However, can we do the same in the Okta Sign-In Widget?

That primary rationale is to avoid having to re-invent the wheel and reuse the widget for as much as we can.

Cheers.

---

<div class="post-metadata">

**Author:** ![tom](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/tom/32/24_2.png) [@tom](https://devforum.okta.com/u/tom)\
**Post date:** [January 8, 2018, 10:39pm UTC](https://devforum.okta.com/t/can-i-use-the-okta-sign-in-widget-oidc-and-normal-okta-session-functionality/998/2 "2018-01-08T22:39:43Z")

</div>

You shouldn’t be passing an `id_token` around applications. `id_token`s are usually bound to the application (client) that asked for an id\_token. An okta session is created when using OpenID Connect, so you could have additional applications make a round trip to Okta to do SSO, regardless of the protocol.

If I understand your question, I believe the answer is yes!

Let me know if you need any clarification though!

---

<div class="post-metadata">

**Author:** ![richard](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@richard](https://devforum.okta.com/u/richard)\
**Post date:** [January 8, 2018, 11:01pm UTC](https://devforum.okta.com/t/can-i-use-the-okta-sign-in-widget-oidc-and-normal-okta-session-functionality/998/3 "2018-01-08T23:01:10Z")

</div>

Hi Tom,

Thanks for your response. In this scenario, App A would host both the app itself and the sign-in widget so we wouldn’t pass the `id_token` to App B or others in this scenario.

In terms of the widget config, my thinking is we would need to configure the widget using the `authParams.display: 'page'` and `authParams.responseType: 'id_token'`. Based on my initial testing, the following results in:

1. An `id_token` be returned to the sign in Widget
2. An Okta session cookie being set on redirect.

```auto
    oktaSignIn.renderEl({ el: '#okta-login-container' },
        function success(res) {
            if (res.status === 'SUCCESS') {
                console.log("success");
                oktaSignIn.token.parseTokensFromUrl(
                    function success(res) {
                        console.log("success.parseTokensFromUrl.success");
                        oktaSignIn.tokenManager.add('my_id_token', res);
                        res.session.setCookieAndRedirect(redirectUrl);
                    },
                    function error(err) {
                        console.log("success.parseTokensFromUrl.error");
                        handleError(err);
                    }
                );
            }
            return;
        }
    );

```

That would seem to tick both boxes in terms of issuing and `id_token` and subsequently being able to access a SAML app integration without being prompted again to authenticate to Okta (as we already have a session, as defined by the cookie). Is that an accurate assumption?

---

<div class="post-metadata">

**Author:** ![tom](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/tom/32/24_2.png) [@tom](https://devforum.okta.com/u/tom)\
**Post date:** [January 9, 2018, 3:20am UTC](https://devforum.okta.com/t/can-i-use-the-okta-sign-in-widget-oidc-and-normal-okta-session-functionality/998/4 "2018-01-09T03:20:43Z")

</div>

Your assumption is accurate. Let me know if you have any issues getting set up!

---

<div class="post-metadata">

**Author:** ![richard](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@richard](https://devforum.okta.com/u/richard)\
**Post date:** [January 12, 2018, 3:47am UTC](https://devforum.okta.com/t/can-i-use-the-okta-sign-in-widget-oidc-and-normal-okta-session-functionality/998/5 "2018-01-12T03:47:30Z")

</div>

Thanks, Tom. Will do.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [January 12, 2024, 10:01pm UTC](https://devforum.okta.com/t/can-i-use-the-okta-sign-in-widget-oidc-and-normal-okta-session-functionality/998/6 "2024-01-12T22:01:44Z")

</div>

Closed on January 12, 2024, 10:01pm UTC

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
