Search the Omeda Knowledge Base

< All Topics
Print

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 NameRequired?Description
OmedaCustomerIdrequiredthe internal id of the customer.
Usernamerequiredthe username for this customer and namespace. Username must be unique for the Brand & Namespace combination.
Passwordrequiredthe 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 ~!@#$%^&*()_-+=?.<>
ExternalCustomerIdNamespacerequiredthe namespace associated with the authentication instance.
StatusCodeoptionalif 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

{
   "ResponseInfo":[
      {
         "Success":"Customer credentials added successfully"
      }
   ],
   "SubmissionId":"c68b1952-03a4-41a0-9b3e-ceb976d96917"
}

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:

OmedaCustomerId not found
Omeda Customer is not active
Username is required
Username cannot be blank
Password is required
Password cannot be blank
Customer already has a Username
Customer {customerId} is not a member of this brand.
ExternalCustomerIdNamespace not found
Error Occurred. Multiple External Customer Namespaces found.
Username {userName} is already in use.
Password Policy not found for Brand.
Multiple Password Policies found.
Password does not meet minimum length requirement.
Password exceeds maximum length requirement.
Password can only consist of alphanumeric characters or ~!@#$%^&*()_-+=?.<>
Failed to process password.
There was a problem saving the password.

A failed POST submission error codes:

StatusDescription
400 Bad RequestTypically, this error occurs when the request does not follow the specifications.
403 ForbiddenTypically, this error occurs when the credentials are erroneous. Potentially, an incorrect x-omeda-appid.
404 Not FoundTypically, this error occurs with a malformed URL or the resource that is searched for is not found.
405 Method Not AllowedTypically, 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 ErrorIn 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

{
   "SubmissionId":"42468454-9708-4b8d-8ffe-3a0decee20a2",
   "Errors":[
      {
         "Error":"OmedaCustomerId not found"
      },
      {
         "Error":"There was a problem saving the account."
      }
   ]
}
Tags:
Table of Contents
Scroll to Top