Configuring Your Client

Overview

In general, two configuration points should be kept in mind:

  1. In the case of web applications (e.g. Angular, React) the application’s URL should be added to the Application’s “Authorized Origin URIs” list found in the Stormpath Admin Console page for the Application.
  2. The application’s base URL should be configured to be your Client API URL. Your application must know to send all Stormpath requests to the Client API URL. Instructions to do that can be found below.

Angular

For an Angular application using the Stormpath AngularJS SDK, the relevant configuration is found in app.js. Add the following line to the config function:

STORMPATH_CONFIG.ENDPOINT_PREFIX = 'https://{DNS-LABEL}.apps.stormpath.io';

Android

For an Android application, in your Application class, change the .baseUrl in the onCreate method:

StormpathConfiguration stormpathConfiguration = new StormpathConfiguration.Builder()
        .baseUrl("https://{DNS-LABEL}.apps.stormpath.io")
        .build();
Stormpath.init(this, stormpathConfiguration);

iOS

For a Swift-based iOS application, in AppDelegate.swift, under application(application:didFinishLaunchingWithOptions:), change the APIURL:

Stormpath.sharedSession.configuration.APIURL = URL(string: "https://{DNS-LABEL}.apps.stormpath.io")!

React

For a React application, the URL is passed as part of the ReactStormpath.init(); call:

ReactStormpath.init({
  endpoints: {
    baseUri: `https://{DNS-LABEL}.apps.stormpath.io`
  }
});