10-07-2021 12:18 PM
We have an in-house API that uses POST and GET calls to send and receive things to and from OnBase. We use JWT Authentication to authenticate these API calls. The issue is that we want to be able to test and demonstrate these calls conveniently in Swagger, but haven’t been able to figure out how to implement an ‘Authorize’ Swagger button, or something similar. There’s a fair amount of stuff online about doing this, but most of it assumes .NET Core and a newer version of Swagger, and we use .NET Framework(my understanding is that we need to use .NET Framework with OnBase).
Can anyone point us in the right direction, or otherwise give us any tips or suggestions about implementing this? Thanks!
Example of what we're hoping for:
10-08-2021 07:03 AM
If you are referring to the Hyland provided APIs, here would be some info.
Unity API - won't work with this. Swagger is based on an Open API specification and REST APIs, neither of which the Unity API is.
Rest API - We do document the REST API in Open API. From the specification on the SDK site there is a download button that will allow you to download the specification, you could then use Swagger to open that specification. When you do that, you should get an Authorize button. I am on a newer version of Swagger I think, but I do get an Authorize button. To leverage it though, you will have to have a separate process for obtaining the Authentication Token from the IdP (for example using Postman). Once you have an Auth Token, you would paste that value into the Swagger UI, and then the Try It Out features should work (make sure to update the server variables too). This would only work if you are using Swagger locally, or your OnBase instance is hosted.
If you are just asking in general for your own in house APIs, there is a lot more that could go into answering that question. But in general if you have a REST API then you would need to have them documented in Open API, and I believe what opens up in when you click the Authorize button is driven by the Security portion of the schema and there are some examples of having a JWT formatted bearer token.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.