Add Authentication
Summary
This API provides the ability to post a username and password to an existing customer for authentication. This can be used to capture the log in credentials to be used for logging into a gated site.
Prior to using the Authentication APIs a Password Policy and Authentication Namespace must be setup. Please contact your Account Representative to start the setup process.
Base Resource URI
For Production, use: https://ows.omeda.com/webservices/rest/brand/{brandAbbreviation}/authentication/add/*
For Testing, use: https://ows.omedastaging.com/webservices/rest/brand/{brandAbbreviation}/authentication/add/*
brandAbbreviationis the abbreviation for the brand to which the data is being posted.
Technical Requirements
The HTTP header must contain the following elements: x-omeda-appid a unique id provided to you by Omeda to access your data. The request will fail without a valid id.content-typea content type supported by this resource. See Supported Content Types for more details.
Supported Content Types
JSONapplication/json
JSON is the preferred data exchange format, because it is lightweight and, in most cases, faster to process and utilizes less bandwidth. There are many available open-source JSON libraries available. See json.org for details.
Supported HTTP Methods
There is one HTTP method supported:POSTSee W3C’s POST specs for details.
Field Definition
The following tables describe the data elements that can be included in the POST method to store authentication data in the database. All fields are required
Authentication Elements
Attribute Name | Required? | Description |
---|---|---|
OmedaCustomerId | required | the internal id of the customer. |
Username | required | the username for this customer and namespace. Username must be unique for the Brand & Namespace combination. |
Password | required | the password for this customer and namespace. The password is case sensitive and it must meet the length requirement that is set in the Password Policy. Password can only consist of alphanumeric characters or ~!@#$%^&*()_-+=?.<> |
ExternalCustomerIdNamespace | required | the namespace associated with the authentication instance. |
StatusCode | optional | if present, the status code must be value 2 (pending activation). Any value other than null, will generate an error. |
Request Examples
JSON Example
{
"OmedaCustomerId":1234,
"Username":"someUser",
"Password":"somePassword",
"ExternalCustomerIdNamespace":"AbcAuth"
}
or
{
"OmedaCustomerId":1234,
"Username":"someUser",
"Password":"somePassword",
"ExternalCustomerIdNamespace":"AbcAuth",
"StatusCode":2
}
Response Examples
Two responses are possible: a successful POST (200 OK Status) or a failed POST (400 Bad Request/403 Forbidden/404 Not Found/405 Method Not Allowed Statuses). See W3C’s Status Codes.
Successful Submission
JSON Example
Error Response
In the event of an error, an error response will be returned. This will result in an HTTP Status 400 Bad Request/404 Not Found/405 Method Not Allowed.
Potential errors:
A failed POST submission error codes:
Status | Description |
---|---|
400 Bad Request | Typically, this error occurs when the request does not follow the specifications. |
403 Forbidden | Typically, this error occurs when the credentials are erroneous. Potentially, an incorrect x-omeda-appid. |
404 Not Found | Typically, this error occurs with a malformed URL or the resource that is searched for is not found. |
405 Method Not Allowed | Typically, this error occurs when the resource accessed is not allowed by the HTTP Method utilized. Make sure you employ the correct HTTP Method (POST) for this request. |
500 Internal Server Error | In the rare case that there is a server-side problem, this response will be returned. This generally indicates a problem of a more serious nature, and submitting additional requests may not be advisable. Please contact your Omeda Account Representative if the issue continues. |
This is not an exhaustive list of errors, but common ones. If an error occurs repeatedly, please contact your Omeda representative.
JSON Example
Table of Contents