Description
I've been using v0.12 and was quite impressed with its implementation. Recently, I decided to upgrade to the latest version, v0.17.1, and noticed numerous changes. Primarily, I utilize this tool for mocking responses. I managed to add the MockResponsePlugin into the configuration and updated the old responses.json file to mocks.json to match the new structure.
However, I've encountered a challenge with token validation. In v0.12, including the token in the Authorization header would simply flag the token itself, but in the current version, it's throwing an error regarding the actual token validity. It appears to be attempting to validate the mock token against the genuine Microsoft token validation endpoint.
HTTP/2 401
content-type: application/json
strict-transport-security: max-age=31536000
request-id: 5fcaa28a-48f2-4120-898f-99726419a2fc
client-request-id: 5fcaa28a-48f2-4120-898f-99726419a2fc
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"West US 2","Slice":"E","Ring":"4","ScaleUnit":"001","RoleInstance":"MW2PEPF0000836F"}}
www-authenticate: Bearer realm="", authorization_uri="https://login.microsoftonline.com/common/oauth2/authorize", client_id="00000003-0000-0000-c000-000000000000"
date: Thu, 09 May 2024 18:10:16 GMT
{"error":{"code":"InvalidAuthenticationToken","message":"Lifetime validation failed, the token is expired.","innerError":{"date":"2024-05-09T18:10:17","request-id":"5fcaa28a-48f2-4120-898f-99726419a2fc","client-request-id":"5fcaa28a-48f2-4120-898f-99726419a2fc"}}}
Given that the purpose of using this tool is to mock up Microsoft GraphQL API endpoints, I need to bypass this validation. I believe there might be a configuration setting I missed in the documentation to achieve this. Could you please advise on how to proceed? Thank you!
Expected behaviour
It skips the validity of the authorization token.
Actual behaviour
It throws an error.
Steps to reproduce
- install the lasted version of the tool.
- run:
curl --header "Authorization: bearer <token>" -ix http://localhost:8000 "https://graph.microsoft.com/v1.0/users/*"
Dev Proxy Version
v0.17.1
Operating system (environment)
Linux
Shell
bash
Configuration file
{
"$schema": "https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v0.16.2/rc.schema.json",
"plugins": [
{
"name": "RetryAfterPlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll"
},
{
"name": "GenericRandomErrorPlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
"configSection": "genericRandomErrorPlugin"
},
{
"name": "MockResponsePlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
"configSection": "mocksPlugin"
}
],
"urlsToWatch": [
"https://jsonplaceholder.typicode.com/*"
],
"genericRandomErrorPlugin": {
"errorsFile": "devproxy-errors.json"
},
"rate": 50,
"labelMode": "text",
"logLevel": "information",
"newVersionNotification": "stable"
}
Additional Info
No response
Description
I've been using
v0.12and was quite impressed with its implementation. Recently, I decided to upgrade to the latest version,v0.17.1, and noticed numerous changes. Primarily, I utilize this tool for mocking responses. I managed to add theMockResponsePlugininto the configuration and updated the oldresponses.jsonfile tomocks.jsonto match the new structure.However, I've encountered a challenge with token validation. In v0.12, including the token in the
Authorizationheader would simply flag the token itself, but in the current version, it's throwing an error regarding the actual token validity. It appears to be attempting to validate the mock token against the genuine Microsoft token validation endpoint.Given that the purpose of using this tool is to mock up Microsoft GraphQL API endpoints, I need to bypass this validation. I believe there might be a configuration setting I missed in the documentation to achieve this. Could you please advise on how to proceed? Thank you!
Expected behaviour
It skips the validity of the authorization token.
Actual behaviour
It throws an error.
Steps to reproduce
Dev Proxy Version
v0.17.1
Operating system (environment)
Linux
Shell
bash
Configuration file
Additional Info
No response