DEFRA / digital-assistance-scheme

Digital Assistance Scheme
2 stars 1 forks source link

EHC Application API's returns 401 Unauthorized #1

Open sreejith-ms opened 3 years ago

sreejith-ms commented 3 years ago

Hi,

I'm testing the below API.

POST https://gateway.trade.defra.gov.uk/trade-sci-exports/uat/v1/ehc-application

When I submit the sample payload from https://localhost:44384/API-Call/EHC-Application/Prepare, I'm getting the response as

{
  "type": "https://tools.ietf.org/html/rfc7235#section-3.1",
  "title": "Unauthorized",
  "status": 401,
  "traceId": "00-01c7cab1a5b0794f8cdd34110158ad8f-5930daec808fda43-00",
  "errors": {}
}

Here is the decoded JWT payload (excluded user info)

{
  "iss": "https://defratradedevportal.b2clogin.com/d7fc6524-4e74-498e-a47d-57aa2e04e0b6/v2.0/",
  "exp": 1621347682,
  "nbf": 1621344082,
  "aud": "7dbab6c7-0908-4788-bd64-515cd3f6006a",
  "sub": "ebb67c8d-4e52-41dc-b990-fb526c9abeb0",
  "oid": "ebb67c8d-4e52-41dc-b990-fb526c9abeb0",
  "scope": [
    "termsAccepted",
    "privacyAccepted",
    "Export.HealthCert.Submit.UAT",
    "Export.HealthCert.Read.UAT"
  ],
  "contactId": "ebb67c8d-4e52-41dc-b990-fb526c9abeb0",
  "organisationId": "00000000-0000-0000-0000-000000000000",
  "delegatedOrganisations": [
    "ee74a99d-c375-4076-9eb6-dd1667cd96de:Agents Ltd.",
    "e17fa226-0e91-4087-a480-d1c2512bfc24:Agents Worldwide"
  ],
  "delegatedRoles": [
    "ee74a99d-c375-4076-9eb6-dd1667cd96de:Write.Notification",
    "ee74a99d-c375-4076-9eb6-dd1667cd96de:Read.Notification",
    "e17fa226-0e91-4087-a480-d1c2512bfc24:All"
  ],
  "scp": "user_impersonation",
  "azp": "36d02c11-7ba5-4f9f-937d-59bcd248ead1",
  "ver": "1.0",
  "iat": 1621344082
}

The GET API (https://dev-trade-gateway.azure.defra.cloud/trade-sci-exports/uat/v1/ehc-application/00000000-0000-0000-0000-000000000000/request-status) for checking the status of the application also returns the same error.

The Reference Data API's are working fine.

DeclanKavanagh commented 3 years ago

Hi @sreejith-ms just got the team looking in to this for you now.