okta / okta-devices-swift

okta-devices-swift
https://github.com/okta/okta-devices-swift
Apache License 2.0
8 stars 1 forks source link

Delete Enrollment Method Error #170

Closed KaannnOzdemiir closed 1 week ago

KaannnOzdemiir commented 10 months ago

Describe the bug?

After enrolling to Okta via iOS and when I invoke SDK's enrollment delete method, I get 401 Unauthorized error from idp/myaccount/app-authenticators/.

Error details: error="invalid_token" error_description="The access token has been revoked."

This is happening because revoke method is invoked before idp/myaccount/app-authenticators endpoint in my opinion.

Some screenshots are provided below.

What is expected to happen?

I was expecting to see delete method works properly and removed enrolments.

What is the actual behavior?

It doesn't remove enrollments

Reproduction Steps?

Steps: 1- Login with Okta and enroll 2- Logout and delete enrollment 3- You should see that SDK is not removing enrollment

Invoked endpoints and statuses during enrollment enroll

Invoked endpoints and statuses during delete enrollment error

Additional Information?

Thank you.

SDK Version(s)

1.1.2

Build Information

No response

IldarAbdullin-okta commented 9 months ago

Hi @KaannnOzdemiir ,

That is totally correct assumption - This is happening because revoke method is invoked before idp/myaccount/app-authenticators endpoint in my opinion.

Please change the sequence of operations. Delete push authenticator enrollment first and then proceed with the sign-out process

Ildar

KaannnOzdemiir commented 9 months ago

Hey @IldarAbdullin-okta , thank you for your answer.