This thread was migrated from an old forum. It may contain information that are no longer valid. For further assistance, please post a new question or open a support ticket from the Customer Support portal.
I am trying to use the calendar adapter from android application. The oath2.0 authentication is working from the browser when I invoked from the android application, When I am calling the calendar events even after succes of identity service it failing. How can I proceed?
@Axduwvhmvn Atkinson Did you create an integration service with Google Calendar?
In order to use the Google Calendar adapter from Kony Marketplace, you must follow three important steps.
Import the Google Calendar Data Adapter,
Create an Identity Service for Authentication, and
Create an Integration Service with Google Calendar
I see from your question that you imported the adapter and created an identity service, but I don't see the third step.
After importing the Google Calendar data adapter and creating the identity service in MobileFabric, you must create an integration service with service type as Google Calendar and associate the integration service with the identity service.
To create an integration service with Google Calendar, do the following:
After logging on to your Kony account, in the left pane, click the API Management menu. The APIs tab opens by default.
Click the Integration tab. The Integration tab opens with a list of existing integration services.
Click CONFIGURE NEW. The Service Definition tab opens.
In the Name box, type a unique name for your service.
From the Service Type list, select Google Calendar.
Note:
The Google Calendar is listed only after you import the Google Calendar data adapter into MobileFabric.
In the Authentication section, from the list box, select the identity service that you created with OAuth2.0. For more information, see Creating Identity Service for Authentication.
Click Save.
If the details provided are valid, the MobileFabric service connects to the Google Calendar API and allows you to make the API calls.
For more information, click the Documentation tab at
The google adaptar already in place. I already have adapter configured in MF. For invoking service from calendar adapter the identity service is mandatory. The oath 2.0 is opening in new browser once we given the user name and password in the browser the control needs to come back to app and trigger the calendar events. The oath2.0 authentication is doing in browser its successful from app side.
and I can create events from MF only. But when I tried from the app its failing.
From MF - everything is working I can create events
From Mobile - Oath2.0 success calendar events failing. (Oath2.0 will open browser in mobile and successfully authenticating. ) but calendar events failing.
Please note from MF its working perfectly
D/StandardLib( 6457): result Inside callIntCalendarService - result: failure{"errcode":17005,"appId":"CalendarCheck","opstatus":17005,"errmsg":"Not authorized","httpresponse":{"headers":{"Access-Control-Allow-Methods":"GET, HEAD, POST, TRACE, OPTIONS","Vary":"Accept-Encoding","X-Kony-Service-Opstatus":"17005","Set-Cookie":"JSESSIONID=77DCB65CD977605F2DB0608DE430FDB7; Path=/services; Secure; HttpOnly","X-Android-Response-Source":"NETWORK 500","Connection":"keep-alive","X-Android-Sent-Millis":"1522632911586","Content-Type":"application/json;charset=ISO-8859-1","transfer-encoding":"chunked","Date":"Tue, 13 Mar 2018 21:48:46 GMT","Server":"Kony","X-Kony-Service-Message":"Not authorized","Content-Encoding":"gzip","X-Android-Received-Millis":"1522632912081","Access-Control-Allow-Origin":"*"},"url":"
It seems from the above thread that you have created the identity service and Integration service as per the documentation and thereby getting a successful response.
In order to use the configured services through your app, you need to invoke the Identity service first before calling the Integration service (to authenticate your integration calls) via your app. Looks like you are directly invoking the Integration service and thus getting Not-Authorized Error.
To know more on invoking an identity service, please refer to Invoking an Identity Service section in the following:
Since your Identity service is OAuth 2.0, you need to refer the section, Login with provider type as OAuth/SAML in the above mentioned documentation.
Also, Google has blocked making OAuth requests via embedded browser widgets, so you might have to use deep linking to launch browser for login and authentication.
For this, You can refer to the section - Login with provider type as OAuth 2.0 with Deep link URL in the above mentioned documentation.
Please revert back if you are not able to proceed further.
The real issue was the authentication is happening from browser and the calendar event is triggered from app side so the google calendar creation was failing. Using the calendar adapter is it possible to do the OAth2.0 validation within the app not in browser?
Google oAuth2.0 doesn't support in app browser so you can authenticate no more using kony browser or native browser widget.
Follow the steps for the google auth and the call your calendar API's.
Call the oAuth service first .
Make a request call to your calendar event.
if it returns you with the error you shared means you havn't authenticated with google oAuth2.0 ( oAuth wih external browser with deeplinking also works ).So call the identity service and authenticate first.
In our app the sync between google calendar and app is required. Every time authentication will not be a good solution. If my understanding is correct the auth token will expire in 3600 m seconds . How can we manage this. Is there any way to manage the calendar adapter and app sync .
Also I observed we cant make any sync scopes by using the calendar adapter any suggestion on these things?