Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authenticate with sessionToken not working #140

Closed
bilal-codal opened this issue Apr 15, 2019 · 8 comments
Closed

Authenticate with sessionToken not working #140

bilal-codal opened this issue Apr 15, 2019 · 8 comments
Assignees

Comments

@bilal-codal
Copy link

Current version okta-sdk-appauth-ios(2.1.0) not supported Native Sign-In,so we are using okta-auth-swift(Beta) for native okta login.

  • We are getting SessionToken after successful login via Beta Okta Swift SDK,
  • When we are used that SessionToken for generating OktaTokenManager, we get an error like Authorization Error: Unexpected response format while retrieving authorization code
extension OktaManager: AuthenticationClientDelegate {
    
    func handleSuccess(sessionToken: String) {
        
        OktaAuth.authenticate(withSessionToken: sessionToken).start().then { (manager) in
               // Success
            }.catch { (error) in
               // Error
        }
    }

Can anyone please guide me if can doing anything wrong.

@IldarAbdullin-okta
Copy link
Contributor

Hi @bilal-codal ,

Could you please double check that both libraries hit the same endpoint? Please check issuer host in Okta.plist and host that you use in native sign-in flow

Thanks!

@bilal-codal
Copy link
Author

Hi @IldarAbdullin-okta,

We have verified issuer host name in Okta.plist and native sign-in flow from okta-auth-swift(Beta) has been same, We still facing the same error.

We have used following code for create AuthenticationClient

client = AuthenticationClient(oktaDomain: URL(string: "{issuer string from Okta plist}"), delegate: self, mfaHandler: self)

Thank you for helping us

@IldarAbdullin-okta
Copy link
Contributor

IldarAbdullin-okta commented Apr 30, 2019

Hi @bilal-codal ,

Please make sure that you also provided the following parameters in Okta.plist
"scopes" - default values are - "openid profile offline_access"
"clientId" - Id of your native application that has been created in your *.okta.com organization
"redirectUri" - details are here

Please let me know if you have other questions

Ildar

@bilal-codal
Copy link
Author

Hi @IldarAbdullin-okta ,

We already created an application in *.okta.com organization and used that clientId in our Okta.plist

Can you please verify my attechement

  • Code for create AuthenticationClient from okta-auth-swift SDK
    Screenshot 2019-05-01 at 11 59 15 AM

  • Okta.plist Screen Short
    Screenshot 2019-05-01 at 11 56 54 AM

Thanks!

@IldarAbdullin-okta
Copy link
Contributor

IldarAbdullin-okta commented May 1, 2019

Hi @bilal-codal ,

Your code and configuration are looks good.
I was trying to find logs for the instance iamtest and didn't find any requests with the path /oauth2/default/v1/authorize.
Could you temporary add me to your test org(as admin) so I can test on my side and check the configuration? You can send invite to the following email - ildar.abdullin@okta.com

Ildar

@IldarAbdullin-okta
Copy link
Contributor

Hi @bilal-codal ,

Any updates regarding reported issue?

Ildar

@IldarAbdullin-okta
Copy link
Contributor

Closing for now. Please re-open if the issue persists

@ahujamanish
Copy link

@bilal-codal were you able to fix the issue? We're facing similar issue on our end too. Thank you so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants