cancel
Showing results for 
Search instead for 
Did you mean: 

Implementing token authorization in Swagger for an OnBase API?

Jonas_McCartha
Champ in-the-making
Champ in-the-making

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:

 

f4defd0b779f468bab04c398a5f6f09d

1 REPLY 1

Justin_Carlson
Employee
Employee

@Jonas McCartha I am a little confused by your opening statement "We have an in-house API that uses POST and GET calls to send and receive things to and from OnBase." So is your organization not using a Hyland provided API (either the Unity API or the REST API)? And are you looking for general assistance on how to get the above to work with your in house built API, or with the Hyland provided APIs?

 

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.

c54c8295405a4503b78cae76530e3132

 

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.

Getting started

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.