Auths

Use /auths to authenticate a user from your app.

Warning

This call is rate limited to one (1) request per user per Service in a five (5) second span and three (3) requests in a sixty (60) second span.

Request

Method:POST
Path:/v1/auths
Content Type:application/x-www-form-urlencoded
Accept Types:application/json

Body

Form URL Encoded String with the following control names:

username:

LaunchKey username, user push ID, or end-user identifier for the user being authorized

app_key:

Service Key of your service. Find this on the Keys tab of your service in the Dashboard.

session:

Optional - Options: [0, 1] - Default: 1 - Flag determining whether this Auth Request is to be designated as a Session. An Auth Request can be designated as a session or transaction based on the needs of your service. Sessions should be used when the User will have the ability to end an active session and log out (e.g. signing in and out of a website or app), whereas transactions are inactive one-way authorizations where the situation doesn't merit the need for the ability to logout/clear (e.g. approving receipt of a package). Sessions are default, but transactions can be specified by sending this value as 0

user_push_id:

Optional - Options: [0, 1] - Default: 0 - Flag determining whether this Auth Request is to return a User Push ID.

auth_request:

Optional - Unique ID to match the response; will be generated if not provided

context:

Optional - Text value to be presented to the user when viewing an auth request on their device. The context allows the user to have confidence that they are responding to the correct request.

policy:

Optional - Authorization policy for this call. The values provided are in a JSON encoded string. The values of this field will be merged with any static policies set for the service in the Dashboard. They cannot be used to make the static policy less restrictive. The policy object can have the following attributes:

minimum_requirements:

Optional - Object identifying the factor requirements for the request.

requirement:Options: [authenticated, enabled] - To require any factors, authenticated is required.
all:Minimum number of factors required
knowledge:Options[0, 1] - Flag determining whether a knowledge factor is required
inherence:Options[0, 1] - Flag determining whether an inherence factor is required
possession:Options[0, 1] - Flag determining whether a possession factor is required
factors:

Optional - List of objects describing auth factors with the following attributes:

factor:

Options: [circle code, pin code, bluetooth proximity, geofence] - The type of factor

quickfail:

Options: [true, false] - Boolean flag when true will immediately fail the auth upon failure of the factor and the mobile device will not process any remaining factors.

requirement:

Options: [forced requirement, allowed] - To require the factor, forced requirement is required.

priority:

Integer value representing the priority of the factor being presented to the user.

attributes:

Optional: Not required for non-geofence factors - Object with the following attributes:

locations:

List of location objects with the following parameters:

radius:A decimal value of the radius for a geofence in meters.
latitude:A decimal value of the latitude in degrees for the center of the geofence.
longitude:A decimal value of the longitude in degrees for the center of the geofence.

Example

POST /auths HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: hgfdså
Accept: application/json

username=dennis&app_key=9999999999&session=1&user_push_id=1&secret_key=qGp%2BBP88k4Sh0CbD8L7ERsu4gKNOnCAt0IB3vB0EoWy44jJiZo5nGS6sTR2VSxJ00l7zRvOIRKYi8pgWqurLEx%2B3W0s7xOFvjJeonuomixDc7Y5CMx5fCNkM6i1KCM%2FhDNpIp93uSCYCYvzuo6Gw6cJx0peG6UUyV%2B6%2Bvn%2F36bLq8fKn6WfKrywzTbBTh52ckvk2kiZiixIiWSyIDrkFDYrW3bwXJsgUrbzkC4vNLDaVGdN8JZYmerJ5fNFiEOUXuvt6mhHFgWfCRljgr3AZTN%2BsmOfNyYCBWU4WPjENyZAUXPIURW5FqqSfyJBnf1Fcf%2FxA%2FQRwiEISVJrWi3scfQ%3D%3D&signature=rk1mJeZ4GeqYZmpCZtZCW%2FD1qR5I69WxOeiLW5gELgSC5sFrsSzhxFdn%2BhkQvHWKWZr6gBAvmdDA63HFLdC9OHD9WxWjgClSUygxO%2F04RUFLS1mKaEfyf9DW8gLl7%2Fdp5wuvrIqZ7DJxfLWOQOZKY0L6gopZ6dYF8szfVs%2B50z%2F3xcl24KQZ1yz13YKB6S2ud3nJsifnp0%2FpqVqB%2BM56Tj5sCqFtel1kJmdY5ayVYBvC5SkzKdqAePcYKxDJm9KSM1mjuXKZ4wD%2BC04kq7qZx2XPGQHC5xf6pmLlZgYwCuk%2BynyWDDjxXAiVk5H1HZYKOmNbWJEQPk%2FIzfTazESFsg%3D%3D

Response

Status:200 OK
Content-Type:application/json

Body

JSON string with the following attributes:

auth_request:string Unique identifier for tracking status of the Auth Request

Example

HTTP/1.1 200 OK
Server: nginx
Date: Sun, 10 Nov 2013 03:56:22 GMT
Content-Type: application/json; charset=UTF-8
Content-Length: 52
Connection: keep-alive
Strict-Transport-Security: max-age=31536000; includeSubdomains

{"auth_request": "4yjuyyg59cqf2s890uhhhx3vmtgv115a"}

Policy JSON Example

Policy example requiring a two factors plus a geofence located at center of the the Taj Mahal with a radius of 60 meters:

{
    "minimum_requirements": [
        {
            "requirement": "authenticated",
            "all": 2,
            "knowledge": 0,
            "inherence": 0,
            "possession": 0
        }
    ],
    "factors": [
        {
            "factor": "geofence",
            "requirement": "forced requirement",
            "quickfail": false,
            "priority": 1,
            "attributes": {
                "locations":[
                    {
                        "radius": 60.0,
                        "latitude": 27.175,
                        "longitude": 78.0422
                    }
                ]
            }
        }
    ]
}

User Contributed

LaunchKey links to user contributed code as a resource to its community. LaunchKey does not in any way guarantee or warrant the quality and security of these code bases. User contributed code is supported by the creators. If you do find a link from the site to user contributed code that is malicious or inappropriate in any way, please report that link to LaunchKey immediately and we will investigate the claim. Submit any issue to LaunchKey support at https://launchkey.com./support. ×