First, make sure you have access to the API Key and Secret for your application:
Key
and Secret
.Establish a tunnel to a local port using the following command:
ssofy listen 8080 -k <YOUR-API-KEY>
Alternatively, you may want to simply share a directory containing json files for testings:
ssofy serve <DIR> -k <YOUR-API-KEY> -s <YOUR-API-SECRET>
The API Secret
is required with serving files as the CLI tool's debugger automatically calculates and attaches the Signature header to response messages.
Here is example files you may use in case you want to give the functionality a try:
First create a directory named ssofy
:
mkdir ssofy
Now let's create files:
# client.json
echo '{
"id": "test",
"name": "Test Client",
"secret": "secret",
"redirect_uris": [
"*"
]
}' > ./ssofy/client.json
# scopes.json
echo '[
{
"id": "email",
"title": "Your email address.",
"icon": "fa-envelope"
},
{
"id": "profile",
"title": "Access to information like name, birthday and gender.",
"icon": "fa-user-shield",
"description": null,
"url": null
}
]' > ./ssofy/scopes.json
# user.json
echo '{
"id": "1",
"hash": "1",
"display_name": "Test User"
}' > ./ssofy/user.json
# auth.json
echo '{
"user": {
"id": "1",
"hash": "1",
"display_name": "Test User"
}
}' > ./ssofy/auth.json
By default, incoming requests are routed to the following paths:
Resource | Path |
---|---|
client | /ssofy/client |
scopes | /ssofy/scopes |
user | /ssofy/user |
password_auth | /ssofy/auth/password |
token_auth | /ssofy/auth/token |
social_auth | /ssofy/auth/social |
otp_options | /ssofy/otp-options |
event | /ssofy/event |
If you wish to route to specific paths, you may configure them within the CLI's config file. The config file must be a json file named ssofy.json
within the directory of the binary execution:
echo '{
"paths": {
"client": "/ssofy/client",
"scopes": "/ssofy/scopes",
"user": "/ssofy/user",
"password_auth": "/ssofy/auth",
"token_auth": "/ssofy/auth",
"social_auth": "/ssofy/auth",
"otp_options": "/ssofy/otp-options",
"event": "/ssofy/event"
}
}' > ssofy.json
You may also configure path visually within the web-based debugger application.
Upon a successful login, you'll be redirected to the web-based debugger application. From there, you'll have access to tools like initiating a login flow, monitoring and debugging requests, and configuring paths.