Michael Klauss
Posts: 0
Joined: Thu Mar 15, 2012 3:55 pm

ADVANCED AUTHENTICATION FOR REST SERVICE

Hi,

I ́m trying connect a service to get a List in a Json Format.

http://riodatamine.com.br/#/api

I created 2 services.

The first is to Connect. It ́s OK but i cant see my access_token in the

answer.

How can i see the answer in the Header Http?

My first service:

---------------------------------------------

Name: Connect
URL: http://api.riodatamine.com.br/rest/re...
Method: get
Data Type: json

Test Connection: Test successful

-----------------------------------------------

The first service returned my "access_token" but i can ́t see.

I need this access_token to call the second service:

http://api.riodatamine.com.br/rest/in...

But i need to put the "access_token" in header request.

I read your answer but i cant understand what JavaScript i need to put.

-----------------------------------------------------------------------

https://getsatisfaction.com/tiggzi/to...

stful_login_service

"Max Katz (Official Rep) 2 months ago
You authenticate from JavaScript, you get a token. Save the token and

use it in other services (with mapping) as usual."

-----------------------------------------------------------------------

I ́m trying found the solution in your answers to other developers, but

i can ́t find the solution to my problem.

https://getsatisfaction.com/people/ma...

Can you help me, please?

Thank you!

Marco.
Brazil - Rio de Janeiro

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

ADVANCED AUTHENTICATION FOR REST SERVICE

I'm getting an error invoking your first service. Do I need any additional parameters?

[quote:]
Error message: GET http://api.removed.com returned a response status of 400 Bad Request
Server response:
[/quote]

Michael Klauss
Posts: 0
Joined: Thu Mar 15, 2012 3:55 pm

ADVANCED AUTHENTICATION FOR REST SERVICE

Hi Max,

Thank for fast!

Yes need to "app-secret" and "app-id"

But i can ́t show these information in public. Right?

Do you work in Tiggzi, right?

Can you see my project?

Yesterday, i bought the PRO plan.

I ́m trying with your article:

http://mkblog.exadel.com/2012/03/buil...

Thank you!

Atenciosamente,
Marco Combat.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

ADVANCED AUTHENTICATION FOR REST SERVICE

Can you send it to a href="mailto:support@tiggzi.com" rel="nofollow"support@tiggzi.com/a?

Michael Klauss
Posts: 0
Joined: Thu Mar 15, 2012 3:55 pm

ADVANCED AUTHENTICATION FOR REST SERVICE

Sent ! Thank you!!!!!!!!

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

ADVANCED AUTHENTICATION FOR REST SERVICE

I tried the service but it just doesn't return anything:

Image

There are no other parameters it requires..?

Michael Klauss
Posts: 0
Joined: Thu Mar 15, 2012 3:55 pm

ADVANCED AUTHENTICATION FOR REST SERVICE

Hi Max!

Thank you again!

The information about my restservice

http://riodatamine.com.br/#/api

-----------------------------------------------------------------------------

Request for Authentication

Authentication is required for an application to the service request-token through the GET method, providing the following arguments:

Code: Select all

  appID - mandatory; 
  appSecret - mandatory; 
  redirect_uri - optional, to indicate the address of the redirect service request-token after its completion (useful, for example, to redirect to a Web-Aplication). 

The URL of calling the service follows the structure:

]http://api.riodatamine.com.br/rest/re...

------------------------------------------------------------------------------

Can i create a local variable to put the [&redirect_uri=] ????????

----------------------------------------------------------------------------

Response to Requests argument redirect_uri

Information returned after the award of a permit:
http://url-fornecido?access_token = & expires =

------------------------------------------------------------------------------------
maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

ADVANCED AUTHENTICATION FOR REST SERVICE

[quote:]
Can i create a local variable to put the [&redirect_uri=] ????????
[/quote]
You can, but the problem is the service doesn't return anything. Do you know why?

Michael Klauss
Posts: 0
Joined: Thu Mar 15, 2012 3:55 pm

ADVANCED AUTHENTICATION FOR REST SERVICE

The service return the access_token in the HEADER

http://riodatamine.com.br/#/api

----------------------------------------------------------------------------------------------

Responding to requests without argument redirect_uri

The service response to a request-token called without redirection address is sent inside the envelope defined for the HTTP/1.1 protocol, according to the following definition:

Code: Select all

  HTTP Status: 
      200 OK: authentication was successful; 
      Request 400 Bad: in the case of verifying the absence of one or more arguments; 
      401 Unauthorized: no authorization was granted to the application; 
      500 Internal Server Error: in case of exception during processing service. 
  Associated Information: 
      200 OK: 
          Location - point added to the header of the reply envelope HTTP / 1.1, the path of service listing the services of Datamine API; 
          X-Access-Token - point added to the header of the reply envelope HTTP / 1.1 with access_token discharged; 
          X-Access-Token Expires - point added to the header of the reply envelope HTTP / 1.1 with temporal validity of access_token. 
      400 Bad Request: 
          X-Error-Reason: missing-parameters; 
          X-Error: access-denied. 
      401 Unauthorized: 
          X-Error-Reason: app-denied; 
          X-Error: access-denied. 
      500 Internal Server Error: stack-trace returned by the exception. 

FORMAT CALL

The Datamine provides consultation of the information it manages through a RESTful API, according to the rules established by the communication protocol HTTP/1.1 (http://www.w3.org/Protocols/rfc2616/r....

Within this context, the invocation of a service should be done by defining a HTTP/1.1 request message, which should be indicated:

Code: Select all

  The access_token obtained through the authentication process, the Authorization parameter, the corresponding header, preceded by the designation "OAuth2.0";
Michael Klauss
Posts: 0
Joined: Thu Mar 15, 2012 3:55 pm

ADVANCED AUTHENTICATION FOR REST SERVICE

Location - point added to the header of the reply envelope HTTP / 1.1, the path of service listing the services of Datamine API;

X-Access-Token - point added to the header of the reply envelope HTTP / 1.1 with access_token discharged;

X-Access-Token Expires - point added to the header of the reply envelope HTTP / 1.1 with temporal validity of access_token.

The access_token obtained through the authentication process, the Authorization parameter, the corresponding header, preceded by the designation "OAuth2.0";

Return to “Issues”