# OIDC get session from OKTA

**URL:** <https://devforum.okta.com/t/oidc-get-session-from-okta/682>\
**Category:** OAuth/OIDC\
**Created:** [November 2, 2017, 1:08am UTC](https://devforum.okta.com/t/oidc-get-session-from-okta/682 "2017-11-02T01:08:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sharilyn](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@sharilyn](https://devforum.okta.com/u/sharilyn)\
**Post date:** [November 2, 2017, 1:08am UTC](https://devforum.okta.com/t/oidc-get-session-from-okta/682/1 "2017-11-02T01:08:50Z")

</div>

Hi,  
I’m using signIn widget for login form, and I configured the OIDC. I have some issues since then.

1. After that, I am not able to sign In with username+password as usual. Instead, it will show that I logged In through Google/Facebook on okta dashboard. Wondering if I’m configured right

2. Social sign on only returns id\_token or accessToken to me. How can I check the user’s session on OKTA? is there a way that I can extend the session?

` var oktaSignIn = new OktaSignIn(config);`

```
      oktaSignIn.renderEl(
        { el: '#okta-login-container' },
        function success(res) {
          if (res.status === 'FORGOT_PASSWORD_EMAIL_SENT') {
            // Any followup action you want to take
            return;
          }

      if (res.status === 'UNLOCK_ACCOUNT_EMAIL_SENT') {
        // Any followup action you want to take
        return;
      }

      // The user has successfully completed the authentication flow
      if (res.status === 'SUCCESS') {
        // Handle success when the widget is not configured for OIDC
      
        if (res.type === 'SESSION_STEP_UP') {
          // Session step up response
          // If the widget is not configured for OIDC and the authentication type is SESSION_STEP_UP,
          // the response will contain user metadata and a stepUp object with the url of the resource
          // and a 'finish' function to navigate to that url
          console.log('SESSION_STEP_UP');
          console.log(res.user);
          console.log('Target resource url: ' + res.stepUp.url);
          res.stepUp.finish();
          return;
        } else if (res[0].claims) {
          console.log("claims");
          // OIDC response

          // If the widget is configured for OIDC with a single responseType, the
          // response will be the token.
          // i.e. authParams.responseType = 'id_token':
          console.log(res);
          console.log(res.claims);
          // oktaSignIn.tokenManager.add('my_id_token', res);

          // If the widget is configured for OIDC with multiple responseTypes, the
          // response will be an array of tokens:
          // i.e. authParams.responseType = ['id_token', 'token']

          // oktaSignIn.tokenManager.add('my_id_token', res[0]);
          // oktaSignIn.tokenManager.add('my_access_token', res[1]);

        
          return;
        } else {
          
          return;
        }
      return;
    }
  },
  function error(err) {
    console.log("error!!!");
    console.log(err);
  });
```

---

<div class="post-metadata">

**Author:** ![bpl18](https://avatars.discourse-cdn.com/v4/letter/b/919ad9/32.png) [@bpl18](https://devforum.okta.com/u/bpl18)\
**Post date:** [April 11, 2019, 9:08pm UTC](https://devforum.okta.com/t/oidc-get-session-from-okta/682/2 "2019-04-11T21:08:57Z")

</div>

Hi,

Did you get any solution to this issue. I’m basically looking for similar thing. Appreciate if you can comment on this.

Thanks.

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [January 17, 2024, 7:57pm UTC](https://devforum.okta.com/t/oidc-get-session-from-okta/682/3 "2024-01-17T19:57:40Z")

</div>


