Search Results :


Single Sign-On (SSO) for Apps Using API Authentication

Single Sign-On (SSO) for Apps Using API Authentication

API Authentication

miniOrange allows you to authenticate your users via API authentication provider into multiple applications.
This way, you can achieve Single Sign-On (SSO) into your applications where the users will need to authenticate themselves via your API Server only once and they can access all the configured applications.

What is API authentication?
Authentication is the method or process by which a user’s identity is verified and recognized. The credentials provided are usually verified against a user store like database, active directory, file etc. API is the interface that allows access to protected resources on request of a user. With remote access to resources it becomes necessary to ensure that only the authorized users have access to the resources. This is where API Authentication comes into play. API Authentication is the process of verifying the identity of the user trying to access resources on the server.

Authentication vs Authorization
Authentication is the process of verifying the identity of the user trying to access a resource and providing proof that the user is who they say they are. Authorization is the mechanism by which one can determine the access level or user privileges of a resource. In simple terms authorization determines if the user in question has been allowed to access the requested resource. Usually authorization comes after authentication. In short, authentication identifies who you are and authorization determines what you can do.

Types of API authentication methods

There are several implementations for API Authentication but the most popular authentication methods as follows:
  1. HTTP Basic Authentication
  2. HTTP Bearer Authentication
  3. API Key Authentication
  4. OAuth Authentication
In all API Authentication methods the aim is to generate a unique hash, token or api key that can be used to authorize further access to resources.

HTTP Basic Authentication
HTTP Basic Authentication is the most common and easiest of the authentication methods. Username and password of the user is combined and Base64 encoded. The result is then passed through a special HTTP header known as Authorization. When a user makes a request, the server decodes the Authorization header to verify the username and password. On successful authentication the user is provided access to the requested resource.

HTTP Bearer Authentication
HTTP Bearer Authentication is similar to HTTP Basic Authentication but uses security access token instead of username and password of the user. The access token is usually a random string generated by the server after successful authentication indicating that the user associated with this token has access to the requested resources. This token is sent in the HTTP Header Authorization by the user to access a certain resource. The HTTP Header is read by the server and validated to check if the it’s valid and should have access to the requested resource.

API Key Authentication
API Key Authentication is similar to HTTP Bearer Authentication but provides more flexibility of where the API Key/Token is sent in the request. API Key is usually a long string of alphanumeric characters usually generated at the time of first login or dynamically generated after successful authentication. On subsequent requests the API Key is sent in the request body or header. The server reads the API Key and validates if it’s a valid key and the authorized resources it can access. This method provides the flexibility to the admin to revoke access at any time.

OAuth Authentication
OAuth currently is the best choice for user authentication and authorization amongst all the authentication methods. In this method when users try to access a resource then they are prompted to authenticate themselves or login. After successful authentication a token is generated which can be used to access resources without having the user to authenticate themselves multiple times. OAuth also allows for better security with tighter scope checks and having a time validity for the tokens. As the token is revoked after a while there are less chances of being used by attackers to gain access to resources.

What are the different types of protocols?


SAML is a widely used XML based SSO standard for exchanging authentication and authorization data between an Identity Provider and Service Provider. It’s mostly used to authenticate and share user information across web applications in a secure manner.


OAuth is a widely used authorization framework that allows two providers to share resources related to a user in a secure manner using scopes and time sensitive tokens.


OpenId is the widely used authentication protocol. It's an authentication layer on top of OAuth2.0 used to verify the identity of the user. Compared to OAuth where user identity is not known OpenId provides a token with user information. This token can further be used to gain access to other resources if needed.


JWT or JSON Web Token is a standard on how data is created. It recommends a fixed JSON format for the token that is signed using a shared secret or private/public key. This is useful in OAuth and OpenID standards where tokens are exchanged containing user data.

We support REST API Authentication using API keys.

In API key authentication, a key-value pair is sent to the API Server either in Request headers or in request body.

For application specific guides of Wordpress, Moodle, Magento, refer our IDP Setup Guides.

Step 1: Fetch API endpoint information

  • Note down the User Authentication URL and the API Key Value required for your API endpoint.
  • User Authentication URL Your API Authentication provider URL.
    API Key The API key value provided by your API Authentication Provider

Step 2: Setup Custom API authentication source in miniOrange

  • Click here and login with your miniOrange account.
  • Navigate to User Stores and click on the Add User Store button.
    wordpress as api authentication source add user store
  • Switch to the API tab and select Custom API from the dropdown.
    wordpress as api authentication source api configuration
  • Provide an API identifier name.
  • Under the Authentication Configuration section, paste the User Authentication URL that you copied in step 1 above.
  • You can pass API key via two different methods i.e. Request Header or Request Body.

In this method, The API key is sent as "Authorization_key" via request header. You can refer to the example below.

  • Provide the Header Name Authorization_key and its value i.e. Value of your API key that you copied in step 1.
  • Select the Method as GET.
  • Provide the Authentication Parameters as:
    Authentication Parameters {
    Note: Extra parameters can be sent in the Authentication parameters section if required. These parameters are added in the format "parameter-name":"parameter-value".
  • API Authentication Configuration Example with API key in header
  • Provide the Status field’s value as status and Status Message field’s value as message.
    Status Name of field in the server response that contains the status code
    Staus Message Name of the field that gives the description of the status in the response

In this method, The API key is sent as "api_key" parameter in the POST body as JSON.

To configure your provider to send API key as a field in request body, you can refer below.

  • In the headers section, provide the Header Name Content-Type and its value application/json.
    (The content-type in the header specifies what type of data is actually sent in the request. Some examples of Content-type can be: application/json; text/html; charset=UTF-8; multipart/form-data; text/plain, etc.)
  • Select the Method as POST.
  • Provide the Authentication Parameters as:
    Authentication Parameters {
    Put the API key value that you copied in step 1 in place of 'value'.
    Note: Extra parameters can be sent in the Authentication parameters section if required. These parameters can be added as fields in request body in the format "parameter-name":"parameter-value".

  • api authentication source user authentication parameters
  • Provide the Status field’s value as status and Status Message field’s value as message.
    Status Name of field in the server response that contains the status code
    Staus Message Name of the field that gives the description of the status in the response
  • (Optional)You can configure extra attributes to be sent from your API source to your service provider. For this, click on the Send Configured Attributes toggle button. You will now be able to see Attribute mapping fields.
    In the first field write the name of the attribute that would be sent to the service provider. In the next field write the name of the attribute that will be received from the API source.
    Attribute Mapping in Rest API Authentication via API Key
  • Click on the Save button.
  • To test the connection, select the user store you just added and click on Test Authorization API.

    api authentication source test authorization api
  • Enter your credentials when prompted and you should be able to see a Success message.

3. Configure your Application in miniOrange


If you have already configured your application in miniOrange you can skip the following steps.

  • Click on Create App under SAML.
  • Click on Create SAML App
  • Search for your Application. In case you do not find your app, search for Custom SAML App.
  • Search for your SAML App Configure SAML Application
  • Get the ACS URL and SP Entity ID from your application.
  • Enter the following values OR click on Import SP Metadata:
  • Service Provider Name Choose appropriate name according to your choice
    SP Entity ID or Issuer Your Application Entity ID
    ACS URL X.509 Certificate (optional) Your Application Assertion Consumer Service URL
    NameID Format  Select urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress
    Response Signed Unchecked
    Assertion Signed Checked
    Encrypted Assertion Unchecked
    Group policy Default
    Login Method
  • Click on Save to configure your application.
  • Now to get the IDP metadata of the app configured, Go to apps >> your_app >> select >> metadata tab.
  • Go to the metadata section
  • Click on the Show Metadata details in the Information required to Authenticate via External IDPs section. Download the metadata XML file by clicking on Download Metadata button or copy the Metadata URL link.
  • Downlaod metadata - URL
  • You need to Upload this metadata in your application.
  • Click on Create App under OAuth/OIDC. Click on Open ID Connect App .
  •  Add OAuth openIDConnect app
  • You can add any OAuth Client app here to enable miniOrange as OAuth Server. Few popular OAuth client apps for single sign-on are Salesforce, WordPress, Joomla, Atlassian, etc.
  • Select your OAuth openIDConnect app Configure OAth AddopenIDConnect app
  • Enter following Values:
  • Client Name Add appropriate Name
    Redirect URL Get the Redirect-URL from your OAuth Client
    Descrption Add if required
    Group Name Default
    Policy Name
    Login Method
  • Click on Save
  • Now to provide the required data to OAuth client go to the app configured i.e apps >> your_app >> select >> edit.
  • Edit OAuth editOpenidConnect app OAuth openidConnect app endpoints

    Note: Choose the Authorization Endpoint according to the identity source you configure.

  • When you want to use you want to use miniOrange as OAuth identity server use this endpoint: https://{}/moas/idp/openidsso
  • If you are configuring any Identity Provider in Identity Providers Menu and not using miniOrange as IDP use this endpoint: https://{}/broker/login/oauth{customerid}
  • Click on Create App under JWT.
  • Click n External JWT app
  • Select JWT App.
  • SelectJWT app
  • Configure the name for your application and configure Redirect-URL which tells where to send JWT response. Redirect-URL should be an endpoint on your application where you want to achieve SSO.
  • Configure JWT App

    In case you are setting up SSO with Mobile Applications where you can't create an endpoint for Redirect or Callback URL, use below URL.

  • Click Save
  • To get the SSO link for your application, Go to Apps >> your_app >> select >> Edit.
  • Get SSO Link
  • Then, copy the Single Sign On Url and verify SSO setup by browsing that url.
  •  SSO URL
  • On successful authentication, you will be redirected to configured Redirect or Callback URL with JWT token
  • You will need to download a certificate from App > Manage Apps, and click Certificate link against your configured application. This certificate will be used for signature validation of JWT response.
  • Download certificate to proceed with SSO

4. Setup Multiple IDPs (Optional)

    You have a choice to set multiple IDPS for Single Application, i.e integrate multiple IDP and users can select IDP accordingly from which they want to authenticate themselves. There are three different ways to authenticate users using IDP.

  • Login using IDP selection page: It gives users an option to Select IDP from the dropdown list during login time.
  • Domain Mapping: Here we map the email domains to a particular IDP. So when the user enters the Email address with a specific domain he would be redirected to the respective IDP.
  • App Identity Provider Mapping: This feature gives users an option to select one specific IDP for their application before login.
  • Note : At once you can select either of them.

  • You can configure multiple IDPs (Identity Providers) and give users the option to select the IDP of their choice to authenticate with.
    For Example - It could be multiple AD domains belonging to different departments or multiple okta organizations.
  • Few usecases where customers configure multiple IDPs -

  • Suppose you have a product which many of your clients use and each client has their own unique IDP so you want them to SSO into your product as well using their existing IDP only. miniOrange provides a centralized way to connect with all IDPs in a very easy manner and integrate SSO into your application.
  • Suppose you are providing a course to many universities, each having a unique SAML, OAuth protocol supported IDP's like Shibboleth, ADFS, CAS, etc. You can provide Single Sign-On (SSO) into your course application to all these universities by integrating with all of them using a single platform provided by miniOrange.
  • This is the endpoint to call from your SAML application -
    For Cloud IDP -<customer_id>
    For On-Premise IDP -<customer_id>
  • You should copy the Customer Key from admin console-> Settings -> and replace it with <customer_id> here. Once configured in SP, when you initiate the login from Service Provider, a user will be redirected to IDP Selection Page listing all IDPs configured for that account.
  • You can see the screenshot below of the IDP Selection Page with a list of IDPs .

    Note: To view the IDP in drop-down list, go to Identity Providers tab > against your configured IDP > Select >Edit , here Enable the Show IdP to Users option.

    Select your IDP (Identity Provider) to login

  • You can also change the look and feel of this page. Login to miniOrange Admin console. Navigate to Customization -> Branding Configuration. See the below screenshot for reference-
    Customize IDP selection login page
  1. You can customize the title of this page.
  2. Change the logo and favicon for this page.
  3. Change the background and button color for this page from admin UI.

If you have multiple IDPs and you want a certain set of users to authenticate from one IdP whereas another set of users to authenticate from another IdP, based on their email domains you can achieve this by using the following steps:- Our domain mapping feature

  • We have provided a Domain Mapping field under each IdP where admins can enter the domain eg. , as shown in the screenshot below.
  • Domain Mapping for selected IDP SSO

    Lets say, there are two organisations under ADFS. One want to authenticate the users under the domain and other one with the domain For reference, We have taken the 2 organisations as two different IDPs and WordPress as SP. Follow the guides to set up ADFS and WordPress at your end.

  • Once the setup is complete you can login through your Wordpress site.
  • So a user logging in with the domain will be redirected to the first organisation under ADFS.
  • Selected IDP Login Page

  • User logging in with email address having domain will be redirected to the second organisation under ADFS.
  • Different Domain IDP SSO login
    SSO Login Page for the selected domain
  • Once the user will authenticate itself through respective Organisations under ADFS, it will be redirected back to Wordpress site.

    If you have multiple IDPs (identity provider) and you want a certain application user to authenticate with one IDP and other application users with another IDP then you can achieve this by our Identity Source Feature.

  • Go to apps >> your_app >> select >>edit.
  • Edit SAML app
  • Here you will have an option called as an Identity source.
  • The dropdown list would show the list of configured IDPs (Identity providers) in miniOrange Identity Providers tab and Userstore.
  • Select one IDP you want for this application. Click on Save.
  • Select IDP from which you want to authenticate users
  • Now the users of this application would be able to authenticate only by the IDP (Identity Provider) selected from the Identity Source dropdown list.

Hello there!

Need Help? We are right here!

Contact miniOrange Support

Thanks for your inquiry.

If you dont hear from us within 24 hours, please feel free to send a follow up email to