Open fhartmann-erp opened 3 years ago
@fhartmann-erp
NOTE: We need to wait for the response of webex.initialize API. After getting the response we need to decide whether we are already logged in or we need to authorize the user.
I used it like in this example:
webex.initialize(CompletionHandler { result -> if (result.error != null) { //already authorised } else { authenticator.authorize(loginWebview, CompletionHandler { result -> if (result.error != null) { //Handle the error }else{ //Authorization successful } }) } })
I also tried it with the KitchenSink Sample App by just pasting a JWT which worked in previous versions and got the same error like mentioned before.
How you generated the JWT token?
With the package io.jsonwebtoken for Android. Also created a JWT Token manually on https://jwt.io/ and it also does not work
Found this in the logs:
2021-06-14 08:31:38.809 9022-9022/com.cisco.sdk_android D/WBX_TEAMS-ch: [FUNCTION_CALL] ZygoteInit.java::1386 main:IOmniusServiceBridge.loginWithJWT()
2021-06-14 08:31:38.815 9022-9094/com.cisco.sdk_android D/WBX_TEAMS-ucf: tid[548225411736] OmniusService.cpp::194 loginWithJWT:Unable to parse Guest Issuer JWT
The JWT-Token i used was working fine in SDK Version 2.8.0. Is there something that got changed where the JWT gets Validated/Parsed?
Does your payload looks like below example? https://developer.webex.com/docs/guest-issuer
I adjusted my payload and in the sample app the token works now but when using the sdk in my java based android application i get an unexpected error -7000 at webex.initialize. After that the app always crashes when initiating a call:
E/libc++abi: terminating with uncaught exception of type spark::expired_reference_exception: NSt6__ndk18weak_ptrI17ITelephonyServiceEE reference has expired A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 30574 (plus.vrvideoapp)
You can not use the Webex APIs until authorised successful (cached or fresh login):
webex.initialize(CompletionHandler { result -> if (result.error != null) { //already authorised } else { authenticator.authorize(loginWebview, CompletionHandler { result -> if (result.error != null) { //Handle the error }else{ //Authorization successful } }) } })
When trying to authorize, even if the initialization-Method throws an error, i get the following error in the logs:
2021-06-14 12:58:32.325 1062-1108/com.erpplus.vrvideoapp E/WBX_TEAMS-ucf: tid[547549303888] OmniusAdapter.cpp::212 operator():Failed to fetch AccessToken from JWT 2021-06-14 12:58:32.331 1062-1112/com.erpplus.vrvideoapp D/Authorize:: null
The same token works in the sample app but not when using the sdk in my java android application
@jbenyovs - request you to please help setup a call with @fhartmann-erp for us to do a screen share
@adamrangs I have setup a Webex space with you and @fhartmann-erp to discuss the details of a call.
I think i've got it to work, i copied the permissions in the AndroidManifest.xml from the Example App in my App and then the authentication works and i could make a call. Is there any new permissions the WebexSDK needs in the newer version?
Good to hear that it works for you.
Seems like the Internet-Permission was missing, didnt need that for the SDK Version 2.8.0. Also, when the app gets launched for the first time the initialize-Method always throws an "Unexpected Error -7000", but if i call the authenticate-Method anyways, it works. Launching the app for the second time, the initialize-Method doesnt throw an error.
I am facing same issue while authenticating JWT token, and error message logged below.
D/WBX_TEAMS-ch: [FUNCTION_CALL] ZygoteInit.java::930 main:IOmniusServiceBridge.getGuestIssuerJwtExpiration() D/WBX_TEAMS-ch: [FUNCTION_RETURN] ZygoteInit.java::930 main:<-- 7ms IOmniusServiceBridge.getGuestIssuerJwtExpiration(): void D/WBX_TEAMS-ch: [FUNCTION_CALL] ZygoteInit.java::930 main:IOmniusServiceBridge.getGuestIssuerJwtExpiration() D/WBX_TEAMS-ch: [FUNCTION_RETURN] ZygoteInit.java::930 main:<-- 7ms IOmniusServiceBridge.getGuestIssuerJwtExpiration(): void W/System.err: java.lang.IllegalStateException: bridge.guestIssuerJwtExpiration must not be null W/System.err: at com.ciscowebex.androidsdk.OmniusWrapper.getGuestIssuerJwtExpiration(OmniusWrapper.kt:211) W/System.err: at com.ciscowebex.androidsdk.auth.JWTAuthenticator.isAuthorized(JWTAuthenticator.kt:44) W/System.err: at com.example.asterciscokotlin.MainActivity$onCreate$1.onClick(MainActivity.kt:29)
Error messages debugging isjava.lang.IllegalStateException: bridge.guestIssuerJwtExpiration must not be null
Since SDK 3.0.0 you have to set the expiration of the JWT. In the previous version it worked without setting the expiration.
When using the same JWT which works with SDK-Version 2.8.0 i always get the error: "JWT Login Failed". When debugging the Error of the jwtAuthenticator.authorize method says error code -7000 "UNEXPECTED_ERROR".