okta / okta-auth-js

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

in signInWithRedirect okta is not setting any sid to cookies #1058

Open karmjeet-peak opened 2 years ago

karmjeet-peak commented 2 years ago

i am trying to login using signInWithRedirect on my app with idp the below configuration but after successfull login app is not setting sid in cookies

config = {
issuer:issuer url,
  clientId: clientid,
  redirectUri: window.location.origin + "/login/callback",
  scopes: ["openid", "profile", "email"],
  pkce: true,
  postLogoutRedirectUri: window.location.origin + "/",
  tokenManager: {
    storage: "sessionStorage",
    autoRenew: true,
    expireEarlySeconds: 30,
  },
}
oktaAuth.signInWithRedirect({
      idp: idp,
      scopes: ["openid", "email"],
      state: "8rFasdfq",
      nonce: "51GPUerUrm",
    });

if any one can help with the issue or anything needs to validate

oleksandrpravosudko-okta commented 2 years ago

Thanks for report @karmjeets.

It looks like cookie might not be set because of 3rd party cookie blocking (see KB post). It is recommended to use customized Okta domain to avoid having 3p cookies issue.

karmjeet-peak commented 2 years ago

Thanks for the your reply @oleksandrpravosudko-okta

I read (KB post) and according to that i am setting the url correct.

I am getting access token and id token but not sid when i try to login with Auth-SDK (providing idp) but when i try to login using signing-widget and provide the credentials then i get all access token id token and sid

I think url is proper added thats why i am getting valid token and sid just that in Auth-SDK case, sid is not being set