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

Issue with the webex initialisation and authorisation #124

Open
hirenpatel8891 opened this issue Apr 27, 2022 · 3 comments
Open

Issue with the webex initialisation and authorisation #124

hirenpatel8891 opened this issue Apr 27, 2022 · 3 comments

Comments

@hirenpatel8891
Copy link

We are upgrading the our Cisco SDK with V2 to V3 version.
In version V3 it's mentioned that before invoking any api webex.initialize is need be invoked.

Here is the implementation for it and I am facing issue in specific use-cases for webex.initialize and authorisation process.
We are using JWT token for the authentication.

    webex.initialize { [self] (isLoggedIn) in
        //            if(isLoggedIn) {
        //
        //            } else {
        if let authenticator = webex.authenticator as? JWTAuthenticator {
            authenticator.authorizedWith(jwt: jwtToken, completionHandler: { result in
                switch result {
                case .failure( _):
                    print("failure")
                    return
                case .success(let authenticated):
                    if authenticated {
                        self.webex.people.getMe(completionHandler: { result in
                            print("getMe",result)
                            if let person = result.data, let personId = person.id {
                                self.personId = personId
                            }
                            DispatchQueue.main.asyncAfter(deadline: .now() + 3.0) {
                                self.connectingWithTheCall()
                            }
                        })
                    } else {
                    }
                }
            })
        }
        //            }
    }

When user disconnect the call we are deauthorizing user with the webex instance.

    self.webex.authenticator?.deauthorize {
        self.webex = nil
        CiscoChatManager.shared().isFirstTimeFechingTheData = false
        print("deauthorize successfully")
    }

Scenario 1 :
Let's assume we have two users in room User1 and User2 respectively.

  • User1 has tried to Join the room by using this JWT token with one device. It has authorised and Joined the room. Somehow user kill the during video consultation and restart the app again.

Issue 1:

  • Now In this case If we try to join the room with User2 with same device isLoggedIn flag come always true as Its authorise for User1.

Issue 2:

  • If we take the approach as above to authorised user every time we are not getting any call back response of authenticator.authorizedWith(jwt: jwtToken) method in this specific use case.

Issue 3:

  • I have also tried to deauthorize user if we get the value of isLoggedIn flag true but In that case application is crashing.

In this usecase user will get blocked. Please check and suggest the approach.

Scenario 2:
The method which we are calling for connecting the call after invoking the webex.initialize has applied delay of 3.0 seconds.

Issue 4:

  • I have observed that If we try to connecting the call as soon as Initialise the webex we are getting Call.Failed error. This error comes almost every-time If we are not putting delay over here. It's observed that any API like getting chat messages, connecting call is not working if we call this API(Methods) immediately after initialise and authorise webex instance.

I have attached the verbose log file for the Issue 2 for Scenario 1 (NotGettingAuhoriseCallBackResponse_Log.txt). NotGettingAuhoriseCallBackResponse_Log.txt

@sandiban
Copy link

Hi Hiren,

Before we proceed further, could I ask you to give it a try with our sample test KitechSink app - https://github.com/webex/webex-ios-sdk-example
Please note, this sample KitchenSink (KS) app is also updated with the latest iOS SDK v3.4.0
We need to get you tried with the sample one since we don't know how your system is designed and working. There might be some error as well.
If you're able to reproduce the same with the KS app, then it's easy for us to reproduce.

And, also post reviewing your statements provided in the ticket, I've couple doubts which we want you to clear -
Upon reviewing your explanation, I have few queries:

Brief your use case
Is both user 1 and 2 on same call or different?
Is there a host on this call to moderate?
For consultation, I would presume you to have a private call and hence not allow two users in the same room. (Unique sessions for each user)

Kindly note, we will not be monitoring the Github portal and have our internal ticketing tool to work on such issues. I request you to share all the details to [email protected] (existing ticket #108490 autogenerated upon Github update) to track this further and extend our communication.

Thank you!
Sandip

@hirenpatel8891
Copy link
Author

@sandiban

Thanks for the reply.

If you want to regenerate this issue in kitchen sink application than you may need to change few line in the code for kitchen sink app.
In the Kitchen Sink App state is persist in the key loginType to UserDefaults. To reproduce this issue comment that logic of
persisting it.
Please comment below line in LoginViewController swift file.
UserDefaults.standard.setValue("jwt", forKey: "loginType")

In the method initializeWebex comment the isLoggedIn if condition code. Same like below
if isLoggedIn {
// self.switchRootController()
// self.handleNotificationRoutingIfNeeded()
} else {
self.loginButton.isHidden = false
}

Step to Reproduce it

  1. Click on Login as Guest
  2. Enter the JWT token
  3. Go to Home Page
  4. Kill the Application and Open it again.
  5. Login screen will be there again. Click on the Login as Guest button. Enter the same JWT token. You will see any callback response will not come.

To answer the your query of the " Is both user 1 and 2 on same call or different?"
We are facing this issue in terms of the authentication . If user is already authorised and we try to authorise with the same token or different token with authorizedWith(jwt:) method we are not getting call back response.

Should I mail this detail to [email protected]? If there is different process than please suggest.

Thanks

@Arman-Morshed
Copy link

HI @hirenpatel8891
Did you find any solution to your problem? I'm facing the same issue.

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

3 participants