Configuring Authentication
To access Square data stores, you must authenticate the connection using the OAuth 2.0 protocol. You can do this by providing a valid access token, or by providing information about your Square application so that the connector retrieves and uses the corresponding access token.
Using an Access Token
If you already have a valid access token, you can authenticate your connection by providing the token in the connection URL.
To authenticate using an access token:
- Connect to the server using a connection URL written in the following format:
jdbc:square://localhost;Host=[Endpoint];Auth_Type=Access Token;Auth_AccessToken=[YourAccessToken];
The variables are defined as follows:
- [Endpoint] is the endpoint of the Square server.
- [YourAccessToken] is your access token.
For example:
jdbc:square://localhost;Host=simbastore.mysquare.com;Auth_Type=Access Token;Auth_AccessToken=kP9PcyQ7prK2LwUMZMpFQ4R+5VE;
Using Square Application Information
You can configure the connector to retrieve and use an access token based on your Square application information. To do this, provide the application ID, application secret, and redirect URL associated with your Square application in the connection URL.
To authenticate using Square application information:
- Connect to the server using a connection URL written in the following format:
jdbc:square://localhost;Host=[Endpoint];Auth_Type=OAuth 2.0;Auth_BaseRedirectUri=[YourRedirectURL];Auth_Client_ID=[YourApplicationID];Auth_Client_Secret=[YourApplicationSecret];
The variables are defined as follows:
- [Endpoint] is the endpoint of the Square server.
- [YourRedirectURL] is the redirect URL associated with your Square application.
- [YourApplicationID] is the application ID associated with your Square application.
- [YourApplicationSecret] is the application secret associated with your Square application.
For example:
jdbc:square://localhost;Host=simbastore.mysquare.com;Auth_Type=OAuth 2.0;Auth_BaseRedirectUri=http://localhost:2500;Auth_Client_ID=f145kn9Pcyq9pr4lvumdapfl4rive;Auth_Client_Secret=45kn9Pcyq9pr4lvu123pfl4r57;
The connector uses these settings to retrieve an access token and authenticate your connection to Square.