Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Credentials types and authentication API needs to be better documented and available in openapi swagger #2152

Closed
vishutyagi000 opened this issue Jan 8, 2024 · 3 comments
Assignees
Labels
documentation Issue in the documentation feature request New feature or request
Milestone

Comments

@vishutyagi000
Copy link

vishutyagi000 commented Jan 8, 2024

Unable to Authenticate to Matrikon OPC Server Simulation Server while calling Browse rest API endpoint.
Calling http://opcpublisher:80/v2/browse/first or http://localhost:80/v2/browse/first.
Successfully hitting the rest API endpoint however got error of invalid user/password.

To Reproduce

  1. On an Edge Device(VM) ,Use OPCPublisher version 2.9.3
  2. Call http://opcpublisher:80/v2/browse/first or http://localhost:80/v2/browse/first
  3. Body Content to pass this post method
{
  "Connection": {
    "Endpoint": {
      "Url": "opc.tcp://OPCSERVERIP:21381/MatrikonOpcUaWrapper",
      "securityMode": "Best",
      "securityPolicy": "http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15"
    },
    "user": {
      "type": "UserName",
      "value": {
        "UserName": "testuser",
        "Password": "password"
      }
    }
  },
  "Request": {
    "view": {
      "viewId": "ns=2;s=0:Random.Int1"
    },
    "nodeId": "ns=2;s=0:Random.Int1",
    "direction": "Forward",
    "header": {
      "namespaceFormat": "Uri"
    }
  }
} 

Getting error Username password invalid.
image

we want to use /v2/browse/first or /v2/browse as per openapi document
https://github.com/Azure/Industrial-IoT/blob/main/docs/opc-publisher/openapi.json

image

As per documentation https://github.com/Azure/Industrial-IoT/blob/release/2.9.3/docs/opc-publisher/definitions.md#credentialmodel

CredentailModel is like
image
But in Source code it is like
image

Here "value" property in user object is not defined in documentation
"user": {
"type": "UserName",
"value": {
"UserName": "testuser",
"Password": "password"
}
}

Not sure how to pass credentials of opc server as this is not described in documentation.

image

Expected behavior
It should browse the OPC Simulation server.

Screenshots
image
image

Desktop (please complete the following information):

  • OS: [Ubuntu]
  • Version [20.04]
  • OPCpublisher version -2.9.3

Additional context
Please share the example request to call http://localhost:80/v2/browse/first or http://localhost:80/v2/browse or any historical data related API.
In continuation with previous clarification needed ,more info can be found on below issue
#2146

@marcschier
Copy link
Collaborator

Yes, it is not documented well. Use "user" and "password" instead of "UserName" and "Password" as property strings.

@marcschier marcschier added the documentation Issue in the documentation label Jan 8, 2024
@marcschier marcschier added this to the 2.9.5 milestone Jan 8, 2024
@marcschier marcschier self-assigned this Jan 8, 2024
@vishutyagi000
Copy link
Author

@marcschier Thank you its working ,is there any way where we can generate these json input for rest endpoints ,will be very helpful.
However thanks for you quick response, should i close this issue?

@marcschier
Copy link
Collaborator

I am thinking we want a typed credential model that is reflected in the open API definition plus some documentation , so let's keep this open for now

@marcschier marcschier modified the milestones: 2.9.5, 2.9.4 Jan 10, 2024
@marcschier marcschier added the feature request New feature or request label Jan 10, 2024
@marcschier marcschier changed the title Unable to Authenticate to Matrikon OPC Server while calling Browse rest API endpoint Credentials types and authentication API needs to be better documented and available in openapi swagger Jan 10, 2024
marcschier added a commit that referenced this issue Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issue in the documentation feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants