Skip to main content

Android

A mobile app is a frontend client: it gets each user token from your own backend, and never holds your client secret. See Authentication.

Vezgo Connect is compatible with the OAuth 2.0 Authorization Code flow (RFC 6749), so it can be added to a mobile app with readily available OAuth libraries. We recommend AppAuth. The flow is the same on every platform:

  1. Register a custom-scheme redirect URI for your app, for example com.yourapp://vezgo. Redirect URIs must be registered with Vezgo.
  2. Get a Vezgo user token from your backend.
  3. Open the Connect URL as the authorization endpoint, with your client ID, the redirect URI, and the user token as an additional token parameter. Skip the code exchange: there is no token endpoint to call.
  4. When the user finishes, Vezgo redirects back to your app. The authorization code it returns is the Vezgo account ID: send it to your backend and store it.

Open Connect​

Use AppAuth-Android. Create an AuthorizationServiceConfiguration with the Connect URL as both endpoints, build the AuthorizationRequest with setAdditionalParameters carrying the user token, and launch it with AuthorizationService.getAuthorizationRequestIntent. In the result, AuthorizationResponse.fromIntent(data).authorizationCode is the account ID. Don't call performTokenRequest.