Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: OAuth 1 authentication  (Read 8329 times)
Stefan S.
Posts: 90


« on: September 20, 2017, 09:53:21 am »

Hello,

we have to connect to a Webservice with an OAuth 1.0 Authentication.

We can receive the consumer-token, but we are not able to get the correct request token.
We always receive an "HTTP/1.1 401 Unauthorized" Error.

Has someone already succeeded an OAuth 1 Authentication with Genero Webservice?

Any help is welcome.

Stefan


Laurent G.
Four Js
Posts: 110


« Reply #1 on: September 20, 2017, 06:10:51 pm »

Hello Stefan,

Our Documentation and Examples are all naming 'OAuth2' (mainly because it is referring to Google Services). Do you have test credentials so you can share a basic sample?
I would recommend you contact your local Four Js support center while you're waiting for some feedback from the community

Best

Laurent
Stefan S.
Posts: 90


« Reply #2 on: September 21, 2017, 07:51:27 am »

Hello Laurent,

attached our testprogram.

I think our Problem is in generating the signature.

We have to build a signature with HMAC-SHA1 (https://tools.ietf.org/html/rfc5849#section-3.4.2)
This should be done like this: digest = HMAC-SHA1 (key, text)

In the Genero-Docu we found the function “security.Digest.CreateDigestString”
This function requires a Base-64 String as Input.
We think that this can be the Problem.


Before you start the program, you have to add the following lines to the fglprofile:


ws.discovergy.url = "https://api.discovergy.com/public/v1/oauth1/consumer_token"
ws.discovergy.verifyserver = "FALSE"

ws.discovergy1.url = "https://api.discovergy.com/public/v1/oauth1/request_token"
ws.discovergy1.verifyserver = "FALSE"




Stefan S.

* disco4JS.4gl (4.58 KB - downloaded 718 times.)
Sisavanh S.
Four Js
Posts: 80


« Reply #3 on: October 05, 2017, 10:35:41 am »

Hi,

Just to let you know that we provided Stephan with a sample.
Indeed, to build the signature there are specifications/conventions you need to comply to.

It is not a complete implementation of OAuth 1.0.
There are 2 main functions
- DoAuth1Request: to do the OAuth request with the signature
- ParseOAuth1RequestTokenResponse: to get the OAuth response

Find attached an excerpt of the sample.

Best regards,
Sisa.

Best regards,
Sisa.

* oauth_sample.4gl (7 KB - downloaded 713 times.)
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines