# Authentication APIs

# Grant type: client_credentials

Method: POST
Path: platform.weomni.com/uaa/oauth/token Recommendation: This grant type is suitable for microservice application as it requires no user information.

  • Request information:

    • Client Id : CoffeeHero
    • Client Secret : mySecret
    • Id:Secret Base64 encode : Q29mZmVlSGVybzpteVNlY3JldA==

    Example Request:

     curl --location --request POST 'https://platform.weomni.com/uaa/oauth/token' \
     --header 'Authorization: Basic Q29mZmVlSGVybzpteVNlY3JldA== \
     --header 'Content-Type: application/x-www-form-urlencoded' \
     --header 'Accept-Encoding: gzip' \
     --data-urlencode 'grant_type=client_credentials'
    

    Example Response:

     {
         "access_token": "xxxxxxxxxxxxxx",
         "token_type": "bearer",
         "expires_in": 599,
         "scope": "inventory.company.w openid inventory.product.d inventory.warehouse.d inventory.location.r camp.coupon.w camp.search inventory.transfer.r inventory.adjustment.r inventory.location.d camp.camp.w inventory.product.w inventory.product.r camp.redeem.w inventory.warehouse.r camp.camp.r inventory.transfer.w redeem.redeem.r inventory.adjustment.w inventory.warehouse.w inventory.location.w inventory.company.r",
         "iat": 1582623379,
         "jti": "d1337fa3-0a3c-4132-b71a-8a051b016315"
     }
    

    # Grant type: password

    Method: POST
    Recommendation: This grant type is suitable for web and mobile applications as it can identify user. Path: platform.weomni.com/uaa/oauth/token

    • Request information:

      • Client Id : CoffeeHero
      • Client Secret : mySecret
      • Id:Secret Base64 encode : Q29mZmVlSGVybzpteVNlY3JldA==
      • weomni username : 66821078890
      • weomni password : Mypassword

      Example Request:

       curl --location --request POST 'https://platform.weomni.com/uaa/oauth/token' \
       --header 'Authorization: Basic Q29mZmVlSGVybzpteVNlY3JldA== \
       --header 'Content-Type: application/x-www-form-urlencoded' \
       --header 'Accept-Encoding: gzip' \
       --data-urlencode 'grant_type=password' \
       --data-urlencode 'password=66821078890' \
       --data-urlencode 'username=Mypassword'
      

      Example Response:

       {
           "access_token": "xxxxxxxxxxxxxx",
           "token_type": "bearer",
           "expires_in": 599,
           "scope": "inventory.company.w openid inventory.product.d inventory.warehouse.d inventory.location.r camp.coupon.w camp.search inventory.transfer.r inventory.adjustment.r inventory.location.d camp.camp.w inventory.product.w inventory.product.r camp.redeem.w inventory.warehouse.r camp.camp.r inventory.transfer.w redeem.redeem.r inventory.adjustment.w inventory.warehouse.w inventory.location.w inventory.company.r",
           "iat": 1582623379,
           "jti": "d1337fa3-0a3c-4132-b71a-8a051b016315"
       }
      
Last Updated: 11/2/2020, 10:42:34 AM