How can I make an Oauth2 authentication from a native android app with a site developed with wordpress?

Asked

Viewed 541 times

0

I have a site developed with wordpress, and not on the wordpress platform.com .

Lately I have been doing tests to use restfull and consume the data via json by native android application.

Only that I would like to be able to authenticate in a safe way using Oauth2 with expired key. I went after a plugin and found https://br.wordpress.org/plugins/oauth2-provider/ even with the paid version. it turns out that I can’t do client-side Oauth2 authentication in the android app.

How do I make this authentição Oauth2 direct with my site in wordpress, the same way we can do using an api with google, facebook, Instagran and others ??

Following the documentation I installed Postman for the browser, where I can see/test what I am sending and receiving from the server.

I set the plugin as

Authorization Code: () HTTP Redirects and WP login form when authenticating. Client Credentials: () Enable "Client Credentials" Grant Type User Credentials: (x) Enable "User Credentials" Grant Type Refresh Tokens: (x) Enable "Refresh Token" Grant Type Allow Implicit: () Enable "Authorization Code (Implicit)" What is this?

and using the configured Postman post www.bancodepeticoes.com? oauth=token

and the fields grant_type password username usernameariodowordpress password passwordwordpress

enable x-www-form-undercoled

after I receive

{ "access_token": "7jaux9vehfjmvshfbxubtcqouz1kdv",

"expires_in": 3600,

"token_type": "Bearer",

"Scope": "basic",

"refresh_token": "nru6pmkpl5clbavwzk0senihtav7mp"

}

now how to fill/require new token access with this information.

in the fields

Token Name: -
Auth URL: -
Access Token URL: -
client id : -
Secret client -
Scope (Optional) Grand type (Client credentials / Authorization code)

I got the basic Autenticacao and I think that then I should raise this access to Oauth2 since I don’t have all this data before. by logging in first only with the username and password.

get the bug

cloud not send request...

cloud not complete Auth2.0 login ...

You can use the google Oauth2 api for this ?

also tried to access

http://www.site.com/GET/posts/2233/revision?Access_token=0ntd3uvec3dgarrh667a0ryyv5qoyb

using the generated token and did not work

inserir a descrição da imagem aqui

I can’t get token renewal on this form. which url to insert into the auth url and access token url fields ????

inserir a descrição da imagem aqui

  • 1

    Apparently the plugin provides an oauth server. The version of the link you posted looks old. But, what error? What did you try? do?

  • I believe that it turns the wordpress installation itself into a server oauth. having basic authentication creating a client and using his id and secret... following the documentation of it using a browser plugin where I can go testing the url... to make the basic authentication works, but when I try with the credentials of the wordpress user, I can’t and I can’t find anywhere else to do it.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.