Dear community,
I could not find any information in the Soap Driver documentation 4.1.0.1 if OAuth2.0 authentication is supported.
Could you please clarify?
Thanks for your help and support
Holger
Application Delivery Management
Application Modernization & Connectivity
CyberRes
IT Operations Management
Dear community,
I could not find any information in the Soap Driver documentation 4.1.0.1 if OAuth2.0 authentication is supported.
Could you please clarify?
Thanks for your help and support
Holger
Hi Holger,
It does not.
But you can implement it reasonable simple youself with an out-of-band request and then just calculate if the token is valid or not everytime you do an operation and then refresh if it is not.
Cheers,
Casper
Hi Casper,
Thanks for your prompt reply.
Do you have coincidentally an example on how to do that?
Thanks
Holger
What I did for a REST driver, was in the OTP as each outgoing HTTP request is headed out, check if it has the token in the event, look at the expire time in a Driver scoped varibale, to see if it has expired. If it has, pause while it goes out and calls the OAuth path, gets the token, expiration, renwal info, re-writes the driver scoped variables and then adds to the current event the proper token.
The key is making the OAuth call from policy and not through the driver. In the REST shim it is pretty easy, since you can use <driver-operation-data> to make a REST call.
Hi Holger,
Do as Geoffrey suggest, that is how I did it.
I am contemplating sharing a package for the REST driver that does this. It would need lots of modifications for SOAP. Like an ECMA REST call to use in the SOAP driver for the OAuth I suspect. If you are willing to update it for the SOAP drver, that would be great. Since I would like to add that on myself, just don't have time right now. But I can sanitize a package and share it, if that helps.
Hello, Geoffrey Carman .
I have excatly this scenario for a REST Driver.
If you decide to share this package, I'd really appreciate it :)
THanks
It is actually reasnoably easy to do.
1) in your startup polity create a rule which sets a few driver scoped variables (url, token and time for the token) to ""
2) somewhere in your driver, before the end of the output transformation create a policy which has a rule which does:
- check if now() > timetoken
- if it is create a document with the operation (look at the driver documentation for how to do do this) to log in. use cmd:execute(destCommandProcessor, <operation>) to send the operation.
- if you get a success, set the driver scope variables with the information you get back
3) where you create your output document for your normal operation, use the driver scope variable to fill out the url (might not be needed) and add the token to the operation.
That is how I did it - took a bit to get things running, but when you get it running then you'll see that it's quite neat.
It's easier with the SOAP driver than the REST driver.
Basically what I did. I share my package with Diego. Be nice if he can add in SOAP OAuth support. Mine was actually JWT support via REST for a strange client that does JWT different than MF does JWT in the shim. :)
See if we can handle more and different auth methods this way.
Did you bother with Refresh? I just get a new token every expiration, since my use case was 1 hour token.
That would have been an option, but I added the timeout calculation so that I would not hit the api limit (immediately). Otherwise it's not worth the effort.
I was thinking of doing it it using the query-token, but that will be for another time - you know query (class-name="login").
My API limit was 40 events in one minute, so the 1 hour access token life was good. But did not want every transaction to request it. So compromise is I used the method you describe, check the expiration time, and if expired pause and get a new one.