Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

Integrating your application with USTA.com is easy. You can use any programming language or tool that supports HTTPS communications.  

This guide is a quick reference that lists the steps for adding Creating a new lightweight USTA account that does not yet exist.  A is a two step process that partners must use to integrate into their applications.  

Step 1:  Integrate Cognito SSO and registration flow into their application via OAUTH2 redirects.
Step 2:  After successfully creating a Cognito native account, redirect to the lightweight registration screen.

 A lightweight USTA account contains the minimum information to satisfy validation that the account does not already exist at USTA.  In order to satisfy validation, a minimum set of criteria must be supplied.  These include the following: 

  • First Name
  • Last Name
  • email
Info
titleImportance Of Email Address

The email address that you will supply when creating the Janrain identity is critical for user login purposes.  This is how the user is uniquely identified for security purposes.  The email supplied will be the user id ('UID') which the user will need to enter if visiting usta.com

Before Development

Before you begin development of your browser-based application, contact USTA to discuss what data you will need to access from USTA.  Credentials will be issued for use to connect via HTTP.

Credentials:

  1. client id
  2. client secret

Scope:

  1. Customer: Insert
  2. Client_Credentials

Environments:

  1. Stage (preproduction)
  2. Prod

Building Your Application

There are three steps to create an account in usta.com:

1)  Register your unique email with Janrain Identity Service.

2)  Retrieve a JWT token from the USTA Auth Service.

3)  Create the account.

This process is safe to perform in either a server application or browser application.  Because the customer UAID is bound to the token, it is safe to store in a cookie.

Image Removed

JanRain Test Account

For the purpose of testing, we have created a dummy Janrain client id for use against the non-prod platform.

...

Step 1:  Register Email With Janrain And Retrieve An Identity Token

The Janrain Identity Service is an cloud vendor that provides the outer layer of security for usta.com.  Each user account that connects to usta.com must have an identity in Janrain.  To create an identity at Janrain, you must supply a unique email address and password. 

This step is required if your application does not already have an active Janrain token.  If you have an active token, you can use that token without carrying out the rest of Step 1.

If you need to retrieve a token:

The USTA bound access model is secured via the Janrain Identity Service.  You must pass in your unique email corresponding to the USTA account for which you would like to retrieve customer information.  Please note that the identity must pre-exist at Janrain before the call is made in order to authenticate and receive an identity token.  The UAID associated with the identity will be the only identity for which you will be able to retrieve data. 

If the email address does not exist at Janrain, there is no customer information to retrieve from USTA.

Headers

This API call uses Basic Authorization.  Use the supplied client_id and secret to generate a Basic Authentication token.  There are many online generators you can use for testing.  One is here.

...

HTTP Call

This is the API call.  Janrain only has two environments.  Please note the difference in base urls:

Test:  https://usta-dev.us-dev.janraincapture.com

Prod: https://usta-prod.us.janraincapture.com

...

URL

...

curl -X POST \
https://usta-dev.us-dev.janraincapture.com/oauth/register_native_traditional \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'cache-control: no-cache' \
-F client_id=afwu4zrn4caebfaf9d375vb5tvee5es5 \
-F flow=standard \
-F redirect_uri=http://localhost \
-F response_type=token \
-F flow_version=20161114171439489756 \
-F locale=en-US \
-F form=registrationForm \
-F response_type=token \
-F firstName=Jonathan \
-F lastName=Cohen \
-F emailAddress=jc985@mailinator.com \
-F newPassword=Jul-2019 \
-F newPasswordConfirm=Jul-2019 \
-F underageCheckbox=true

Data/Payload

You must use the client_id and currentPassword assigned by USTA.  The signInEmailAddress is your unique user identity at Janrain. 

All other values are static and should be supplied as written below.

...

<PASSWORD>

...

<MUST BE SAME AS newPassword>

...

Result

The important info returned from this call are the following:

access_token: The identity token representing the logged in user.

Code Block
languagexml
titleResult of https://usta-dev.us-dev.janraincapture.com/oauth/auth_native_traditional
{
   ...,
   "stat": "ok",
   "access_token": "bs7qz5fhv87vqp6j"
}

Example

This example uses CURL from the command line.

Panel

https://usta-dev.us-dev.janraincapture.com/oauth/register_native_traditional -H 'Content-Type: application/x-www-form-urlencoded' -H 'Host: usta-dev.us-dev.janraincapture.com' -H 'cache-control: no-cache' -d 'client_id=afwu4zrn4caebfaf9d375vb5tvee5es5&flow=standard&flow_version=20161114171439489756&locale=en-US&redirect_uri=http://localhost&response_type=token&form=registrationForm&emailAddress=cs-test999x@mailinator.com&newPassword=Tennis321&newPasswordConfirm=Tennis321&lastName=Sose&firstName=Kaiser'

...

This API calls the USTA OAuth Service to retrieve a JWT token that will be used to define the scope of permissions for future calls.  Please note that if you are working within the context of a browser application, this token will be visible to users and could be used for subsequent calls.  This is the equivalent of establishing a durable session.

Headers

This API call uses Basic Authorization.  Use the supplied client_id and secret to generate a Basic Authentication token.  There are many online generators you can use for testing.  One is here.

...

HTTP Call

This is the API call.  Please note the difference in base urls:

Test:  https://stage-services.usta.com

Prod: https://services.usta.com

...

URL

...

Result

The important info returned from this call are the following:

jti:  token that will be passed in subsequent calls

exprires_in: the Time To Live of the token

Code Block
languagexml
titleResult of https://stage-services.usta.com/v1/oauth/token?grant_type=client_credentials
{
    ...,
    "jti": "7b5f8ede-bbc1-4b2b-b127-a6f0e9dfb8cd"
}

Example

This example uses CURL from the command line.

Panel

curl -X POST 
'https://stage-services.usta.com/v1/oauth/token?grant_type=janrain_token
-H 'Authorization: Basic ZTc2ZGQxZWItZjVjMC00MDFiLWFjYTktZWYxZGRlNTcyYzg4OkhOOUU2U2ovdmtWUWEyR2pKYUxBSDF4WndWTzN0dHZWQmJRQnpRaVlpbWc1RWFvVVJ5bUVhTzc4SVRtNVh5NjQzSUo0UThTcHpTNXQ2c2Jz'

Step 3:  Create The USTA Account Using JWT Token

Once you have a JWT token, you can use it to make API calls.  In this case, we will call '/customers' with the POST verb.

Headers

...

Payload

At a minimum, to create a USTA lightweight account, you must provide firstName and lastName and the Janrain identity token.

...

janrainToken

...

Application Result

If you are calling this API from a server application, the result is an HTTP status code. 

200 OK

or 

Code Block
titleError Status
{
    "errors": [
        {
            "errorCode": 3002,
            "message": "entity already exists"
        }
    ]
}

Browser Result

If you are calling this API from the browser, the result sets a number of cookies.

...

Sample Call

This example uses CURL from the command line.

...

languagebash
titleCurl Call

...

  • Date of Birth
  • Zip Code
  • Gender (Optional)
  • Legal Consent (Terms of Use, Privacy, At least 13 years of age_

This process is fully described at the following:  Registration/Sign Up