Hello there!

Need Help? We are right here!

Support Icon
miniOrange Email Support
success

Thanks for your Enquiry. Our team will soon reach out to you.

If you don't hear from us within 24 hours, please feel free to send a follow-up email to info@xecurify.com

Search Results:

×

Single Sign On (SSO) For Your 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

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/OAuth2

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

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

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.

Get Free Installation Help


miniOrange offers free help through a consultation call with our System Engineers to configure SSO for different apps using API authentication in your environment with 30-day free trial.

For this, you need to just send us an email at idpsupport@xecurify.com to book a slot and we'll help you in no time.



Follow the Step-by-Step Guide given below for SSO for your apps using MariaDB database

1. Fetch API endpoint information

    li>Note down the User Authentication URL and the API Key Value required for your API endpoint.
    User Authentication URL Your API Authentication provider URL.
    Eg: https://example.com/endpoint/
    API Key The API key value provided by your API Authentication Provider

2. Setup Custom API authentication source in miniOrange

  • Login with your miniOrange account.
  • Navigate to External Directories and click on the Add Directory button.

    Add User store for Moodle Authentication
  • 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 {
    "username":"##username##",
    "password":"##password##"
    }
    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
  • Click on the Save button.
  • To test the connection, select the user store you just added and click on Test Authorization API.
  • Test authorization api

  • Enter your credentials when prompted and you should be able to see a Success message.

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 {
    "api_key":"value",
    "username":"##username##",
    "password":"##password##"
    }
    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
  • Click on the Save button.
  • To test the connection, select the user store you just added and click on Test Authorization API.
  • Test authorization api

  • Enter your credentials when prompted and you should be able to see a Success message.

3. Configure your app in miniOrange


Note:

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
    Description 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://{mycompany.domainname.com}/moas/idp/openidsso
  • If you are configuring any Identity Provider in Identity Providers Menu and not using miniOrange as IDP use this endpoint: https://{mycompany.domainname.com}/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.

    https://login.xecurify.com/moas/jwt/mobile

  • 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. Configure your Application in miniOrange


Note:

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
    Description 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://{mycompany.domainname.com}/moas/idp/openidsso
  • If you are configuring any Identity Provider in Identity Providers Menu and not using miniOrange as IDP use this endpoint: https://{mycompany.domainname.com}/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.

    https://login.xecurify.com/moas/jwt/mobile

  • 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

External References

Want To Schedule A Demo?

Request a Demo
  



Our Other Identity & Access Management Products