NativeScript Sidekick

Using Enterprise Authentication

NativeScript Sidekick lets you connect to existing enterprise identity and single sign-on solutions. This powerful functionality allows application developers to leverage enterprise user accounts, and to do so while avoiding the complexity of integrating these protocols into mobile apps.

Let’s look at how it works.

Step 1. Start your app

As a first step, create a new app using the Enterprise Auth template.

Give your app a name, and click Create. Sidekick will take a minute to scaffold your app and when it's done, you should head to the Kinvey Console to create and configure the actual Auth service.

Step 2. Create the auth service

WARNING: Completing this authentication setup can be hard, as the information you need to obtain varies depending on your auth provider. Therefore, you might need to work with your IT admins to help get the information that you need to make the connection, especially if you're not familiar with the infrastructure behind your auth setup.

How to create and configure an authentication service through the Kinvey Console is explained in the Configure Auth Service article in the Kinvey Dev Center. The Enterprise Auth app created in NativeScript Sidekick currently supports the SAML-Redirect, OpenID Connect, and OAuth 2 types of authentication. Knowing which service you need means knowing a little bit about your enterprise authentication provider. Some providers only support one of the above protocols, while others allow you to choose between the protocol you prefer.

Once you’ve figured out which protocol your service supports, you should head to the specific section in the Kinvey Dev Center:

Step 3: Complete the configuration

Each authentication service requires a different set of values needed to make the connection. Therefore, refer to one of the following guides to help complete the rest of the necessary configuration.

Step 4: Run your app

After you’ve completed the authentication setup, your last step is to run your app and see your new authentication workflow in action.

TIP: If you haven’t run an app on a device using NativeScript Sidekick before, check out our documentation on running your app.

After Sidekick deploys your new app to your device(s) you should see an app that looks like this.

When you tap the Log in button, if all went well, you should be prompted to authenticate with your enterprise authentication provider. In the case of our Microsoft Azure-based example, the app prompts the user to authenticate with their Microsoft account.

NOTE: Configuring enterprise authentication providers is very tricky. If you’re not seeing your auth screen as expected, or if you hit problems at any time throughout the process, feel free to reach out on Stack Overflow.

And that’s it! You’ve now successfully built an app that can connect to an enterprise authentication provider.

What else can I do with my Kinvey account?

Your Kinvey account also gives you access to a ton of additional features beyond just Mobile Identity Connect. Some of them include:

  • NoSQL data stores and file stores that can serve as a back end to your app.
  • Push notification support for your NativeScript app.
  • RapidData lets you connect your NativeScript mobile app to existing enterprise data sources like SQL Server, SharePoint, Salesforce, SAP and REST.
  • FlexServices allow you to build complex data integrations or add functional business logic that lives in the cloud (aka serverless).

For a full overview of Kinvey features and how to use them, visit the Kinvey Dev Center.