Code Monkey home page Code Monkey logo

wordpress-oauth-server's Introduction

=== WP OAuth Server ===

Contributors: justingreerbbi
Donate link: http://justin-greer.com/
Tags: OAuth2 Service, oauth2, OAuth provider, Provider, OAuth, OAuth client, Single Sign On, SSO, OpenID Connect, OIDC, OpenID, Connect
Requires at least: 4.3
Tested up to: 4.5
Stable tag: 3.1.98
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Create and Manage an OAuth 2.0 server powered by WordPress. Become a Single Sign On Provider and or resource server.

== Description ==

This plugin is a full OAuth 2.0 authorization server/provider for WordPress. 
The goal of WP OAuth Server is to provide an easy to use authorization method that 3rd party platforms can use to securely authorize users from your WordPress site.

NOTE: WP OAuth Server has moved the version 3.2.0 release to wp-oauth.com. WP OAuth Server 3.1.X will still be hosted here at 
WordPress.org but will only contain the Auth Code grant type.

= Features =
* Works with WP REST API/ JSON API. Access protected endpoints via OAuth2
* Create and Manage a client.
* Built-In Resource Server. You can either extend the resource server or JSON API. You pick.
* Automated Authorization for Single Sign On using WordPress as the provider.
* Extendable

= Supported Grant Types =

* Authentication Code


NOTE: WP OAuth Server 3.2.0 Supports all grant types including:

* Auth Code
* Client Credentials
* User Credentials
* Implicit Flow
* OpenID Code
* OpenID Implicit

You can purchase 3.2 + by visiting http://wp-oauth.com.

= How to Use =

Visit https://wp-oauth.com/knowledge-base/ for detailed documentation on installing, configuring and using 
WordPress OAuth Server.

= Licensing = 

Licensing is not needed to use this plugin. WP OAuth Server 3.1.X is limited grant type and functionality. Using WP OAuth Server 
without licensing is perfectly fine and encouraged. if you would like to have more than 1 client and the ability use ALL the grant types,
you will need to purchase a license and download WP OAuth Server 3.2+ at https://wp-oauth.com.

= Minimum Requirements =

* PHP 5.6 or greater *(latest version recommended)*
* OpenSSL installed and enabled if you plan on using OpenID Connect

= Other Information =

* NOTE: As of 3.0.0, there are no backward compatibility for any version older than 3.0.0
* NOTE: Due to IIS's inability play nice, WP OAuth Server may work but is not supported on Windows OS.

= Support =

Support requests should be made by opening a support request at https://wp-oauth.com/account/submit-ticket/.

== Installation ==

1. Upload `oauth-provider` to the `/wp-content/plugins/` directory or use the built in plugin install by WordPress
1. Activate the plugin through the 'Plugins' menu in WordPress
1. Click 'Settings' and then 'permalinks'. Then simply click 'Save Changes' to flush the rewrite rules so that OAuth2 Provider
1. Your Ready to Rock

== Frequently Asked Questions ==

= How do I add a APP/Client? =
Click on `Settings->OAuth Server`. Click on the `Clients` tab and then `Add New Client`. Enter the client information and your are done.

= Does WordPress OAuth Server Support SSO (Single Sign On) =
Yes, WordPress OAuth Server does support Single Sign On for both Traditional OAuth2 Flow and OpenID Connect.

= Is there support for this plugin? Can you help me? =
You can visit our https://wp-oauth.com/account/submit-ticket/ to open up a support request directly with developers.

= Can you set this up for me on my current website? =
* DRINKS COFFEE * Can I? "YES". You are more than welcome to contact us with if you should ever need assistance.

= How do I use WordPress OAuth Server? =
You can visit https://wp-oauth.com/knowledge-base/. You will find in-depth documentation as well as examples of how to get started.

== Upgrade Notice ==

Version 2.0.0 and lower are not compatible with version 3.0.0. If you have built your service using version 2.0.0 or lower, visit https://wp-oauth.com/account/submit-ticket/ to open a new request support request.

For any upgrade or modification, PLEASE PLEASE PLEASE make a full backup of your data. 

== Screenshots ==

1. Adding a Client

== Changelog ==

= 3.1.97 =
* Bug fix in openID sub return parameter.
* Added notice about upgrading and continuation of WP OAuth Server in WordPress plugin repository.

= 3.1.96 =
* Restructuring and clean up.
* Refresh token controller now accepts parameters properly.
* Rewrote rewrite functionality to fix issues regarding rewrites on ever load.

= 3.1.95 =
* Removed ALTER query. There is no need and someone updating from older version will experience issues anyways. Step by step upgrading is required.
* Fixed issues when updating and options key is missing. This caused header errors that have full error reporting on.

= 3.1.94 =
* Updated generateAuthorizationCode() to use wp_generate_password()
* Fixed bug with expires_in not retuning as integer

= 3.1.93 =
* Updated OAuth2 Library and re-ported to WP.
* Updated AuthorizationCode handler to manage id_token delivery.
* Fixed invalid id_token issue.

= 3.1.92 =
* Moved located of do_action('wo_before_authorize_method'); add added $_REQUEST parameter.
* Rearranged OAuth Server menu for flexibility
* Added $_REQUEST parameter to wo_before_api action
* Add wo_failed_login action when login fails for OAuth2\Stoarge::checkPassword during user credentials grant type
* Added wo_user_not_found action when user is not found when using user credentials

TODOS
* Add http://php.net/manual/en/function.apache-get-version.php function check before running it.

= 3.1.91 =
* Added action wo_endpoint_user_authenticated which runs before resource method but after access token authentication.

= 3.1.9 =
* Changed default refresh token lifetime to 10 days
* Permalinks now check before re-writing
* Minor code refactoring
* Added action wo_set_access_token that runs before creating an access token

= 3.1.8 =
* Optimized activate hooks for better performance and consolidation of code.
* Started minimization of the code to unneeded overhead,
* Added removal of access tokens when a user resets password.
* Fixed issue with refresh tokens not being returned when using refresh_token grant type
* Added functionality to allow for public endpoints.

= 3.1.7 =
* Added MySQL check during install
* Fixed 404 bug for unset permalinks
* Minor security improvements

= 3.1.6 =
* Fixed 404 errors when adding/editing clients

= 3.1.5 =
* Addressed security issues on older PHP versions as well as Windows OS.
* Added checks to help ensure that the environment is supported before WP OAuth Server can be ran.
* Add filter 'wo_scopes' to allow for extendability.

= 3.1.4 =
* Fixed bug in refresh token that prevented use of refresh tokens

= 3.1.3 =
* Forced all expires_in parameter in JSON to be an integer
* Add determine_current_user hook for WP core authentication functionality
* Added authentication support for WP REST API

= 3.1.2 =
* Patch to possible exploit when editing a client.
* Slight UI changes.
* Patched auth code table for large id_tokens.
* Fixed security issue with token lifetime.

= 3.1.1 =
* Client name is not click able to show edit popup
* Fixed issue with missing exits in API

= 3.1.0 =
* Added specific OpenSSL bit length for systems that are not create keys at 2048 by default.
* Added urlSafeBase64 encoding to Modulus and Exponent on delivery.
* Tweak redirect location in API when a user is not logged in

= 3.0.9 =
* Added userinfo endpoint to /.well-known/openid-configuration 
* Fixed improper return of keys when for public facing /.well-known
* Auto generation of new certificates during activation to ensure all server have a different signature

= 3.0.8 =
* Switched JWT Signing to uses RS256 instead of HS256.
* Added OpenID Discovery with REQUIRED fields and values.
* "sub" now complies with OpenID specs for format type.
* Added JWT return for public key when using OpenID Discovery.

= 3.0.7 =
* Bug fix in OpenID

= 3.0.6 =
* Fixed "Undefined Error" in Authorization Controller. Credit to Frédéric. Thank You!
* Remove "Redirect URI" Column from clients table to clean up table on smaller screens.
* Updated banner and plugin icon.

= 3.0.5 =
* Removed permalink check. OAuth Server now works without the use of permalinks.
* Fixed install functionality. Not all tables were being installed.
* Added support for cytpto tokens.
* Added OpenID Connect abilities.
* Mapped OpenID Claims to default user values
* Added index to token table and increased access_token length to support crypto tokens in the future.
* Added "email" to default me resource to support OpenID Connect 1.0
* Added generic key signing for all clients.
* Added public endpoint for verifying id_token (/oauth/public_key)

= 3.0.4 = 
* Updated Readme.txt content
* Add more descriptive text during PHP version check
* Fixed license links
* Added Access Token and Refresh Token lifetime settings
* Added upgrade method to ensure proper installing of new features

= 3.0.3 =
* Modified how clients are added and edited
* Add Pro Features
* Added additional information to "Server Status" Tab
* Minor Clean Up

= 3.0.2 =
* Re added Authorization Code Enable Option
* API unavailable error now uses OAuth Response object
* API now reports when access token is not provided during resource calls

= 3.0.1 =
* Updated cover image.
* Fixed documentation links.
* Added "Server Status" tab
* Cleaned up "Advanced Configuration" contents.

= 3.0.0 =
* Updated and rebuilt structure.
* Visit <a href="http://wp-oauth.com">http://wp-oauth.com</a> for documentation and more information.

= 2.0.0 =
* Rebuild init plugin code structure for more flexibility and scalability.
* Added prefix to all DB connections
* Changed install query to use the InnoDB engine for better support and performance.
* Fixed improper loading of plugin style sheet.
* Removed garbage data when plugin is activated. It was not being used and cluttering the code base as well as the database.
* Move action template_redirect to rewrites file
* Added login form support for installs that are installed in sub directory
* Added missing in documentation for when calling requesting_token
* Suppressed some errors that was preventing a proper JSON return when `WP_DEBUG` was enabled.
* Added a client sample script to help learn the basics of connecting to the provider plugin.
* Add legacy installer that will hopefully keep old data in tacked while updating to the new structure with no data loss.
* Removed plugin logging as it was not really needed and caused more issues that it was worth.

= 1.0.3 =
* Fixed Admin URL links for plugin dashboard

= 1.0.2 = 
* Fixed Broken login redirect

= 1.0.1 =
* Re-worked Readme.txt
* Fixed absolute paths causing 404 Error when WordPress is running under a sub directory (Using admin_url() currently)

= 1.0.0 =
* INITIAL BUILD

wordpress-oauth-server's People

Contributors

aptarmy avatar gamaoff avatar justingreerbbi avatar jwickard avatar louisptremblay avatar neiltron avatar sillevl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wordpress-oauth-server's Issues

Revise wo_ap_et_access_token_for_user

function wo_ap_et_access_token_for_user() {
global $wpdb;

$current_user = get_current_user_id();
$check        = $wpdb->get_row( "SELECT * FROM {$wpdb->prefix}oauth_access_tokens WHERE user_id ={$current_user}" );

return $check;

}

Needs to be:

function wo_ap_et_access_token_for_user() {
global $wpdb;

$current_user = get_current_user_id();
$query        = "SELECT * FROM {$wpdb->prefix}oauth_access_tokens WHERE user_id = %d";
$query        = $wpdb->prepare( $query, $current_user );
return $wpdb->get_row( $query );

}

NOTE: The prepare() method of $wpdb ensures security of the query.

https://developer.wordpress.org/reference/classes/wpdb/prepare/

3.0.2

Version 3.0.2

When trying to authenticate I've received the following error:

"An unsupported scope was requested"

I manually added "auth" scope to the oauth_scopes and set scope field in oauth_clients table to "auth" and now receiving the following error:

"Not a valid access token"

Is there any way to configure scopes in the WordPress OAuth Server plugin?

state parameter is required

It is currently require to pass state parameter to the authorize method.
I have a use case in which no state is require, for simple authentication.

It will be easier to use this plugin if state parameter will be optional.

Login page

Is it possible to use the standard wordpress login page to authorizations?

Thanks.

PHP 7.2 incompatibility

Upon installing and creating an account I get the following error when trying to use the default Postman OAuth2 test-scenario:

image

Server details:

image

Mulit-press support

This may already be supported, but I did not find that in the docs. Without explicit support we would like to know of course before using it on a multi-site.

Adding a "new client" results in undefined index in modal

In my local install, when doing a test ride with your plugin, I get the following error here:

Notice: Undefined index: license in /var/www/dev/public/wp-content/plugins/oauth2-provider/library/content/create-new-client.php on line 131

The problem is that you assume in

if (!_vl($options['license']) && has_a_client())

that from get_option('wo_options'); the $options['license'] key is always set. Looking at the markup (no, I didn't debug this to the end), I can see the HTML form field:

<input type="text" name="wo_options[license]" value="" length="40" style="width:300px;">

In short: If this is not filled, the other fields that depend on this should simply either have a disabled attribute or should not get displayed at all.

Internet Explorer: /oauth/tokens throws 400

Nevermind, was my fault. Feel free to delete. Sorry...

Hey,
whenever I'm trying to log get the token by requesting /oauth/token I get a 400.
This makes the plugin unusable for Internet Explorer, every other browser works as expected though.

Any suggestions?

Github out of sync

Hello @justingreerbbi,

The github repository is out of sync with the actual plugin state. I have some additions I'd like to share for prelimary multisite support but these are now based of the current code which still is on 3.1.8.

404 /oauth/authorize

Going to settings and resetting the permalinks does not happening and changing them manually to /oauth/{method} or ?oauth={method} still comes up with a 404 and /oauth/authorize not found.

redirect_uri_mismatch

I'm getting a redirect_uri_mismatch, and I can't track down what the source of the problem is. Any idea why this error is popping up?

To state the obvious, oAuth Server has the redirect url set as https://app.example.com/_oauth/wordpress, which is correct. I've tried both with and without the trailing slash at the end, with and without https://, so I've run out of ideas.

Thanks!

screen_shot_2017-06-13_at_3_36_18_pm

GET request with BEAR authorization returns 403

I'm making REST api request using the bear authorization but kept on getting forbidden request 403. The wordpress version I'm using is 4.6.1 and WP-Rest-API version 2.0-beta-15. I'm seeing this behavior in WP-OAuth-Server version 3.1.98.

In WP-Admin under Clients tab the edit link of a client does not work

Repro:

  1. Go into WP-Admin (that has the plugin of course)
  2. Go into Clients tab
  3. Add a client
  4. Hover with the mouse over the client's row and press the edit link

Expected Result:
Show a dialog which allows to change some of the information about the client

Actual Result:
Nothing shows, the page jump to the top.

Notice - Header 'Authorization Basic' may not work as expected.

Notice - Header 'Authorization Basic' may not work as expected.

wp version 4.6.1
hosting godaddy windows shared hosting
php version 5.6.1

**Server Status
The following information is helpful when debugging or reporting an issue. Please note that the information provided here is a reference only.

Plugin Build: 3.2.001
PHP Version (5.6.26): OK
Apache Version: apache_get_version() not enabled.
Running CGI: Notice - Header 'Authorization Basic' may not work as expected.**

Example of config

Hello, do you example of config for this code?

class ConnectOauth
{       
    protected function _init(Config $config)
    {
        $config->append(array(
            'service_name'      => 'Wordpress Oauth',
            'api_url'            => 'XXX',
            'request_token_url' => 'XXX' ,
            'authorize_url'     => 'XXX',
            'access_token_url'  => 'XXX' ,
            'authenticate_url'  => 'XXX'        
        ));

        parent::_initialize($config);
    }

     /** Return the current user data*/

     protected function _getUserData()
     {
        $profile = $this->get('XXX/XXX.json');

        $data = array(
            'email'        => $profile->email,
            'name'     => $profile->name,
            'username' => $profile->screen_name,
            'avatar'  => $profile->profile_image_url          
        );

        return $data;
     }
}

Any plans to support refresh tokens?

Hey Justin, thanks for your help troubleshooting last month. I have a new question for you.

It doesn't look like the plugin currently supports using a saved refresh token to obtain a fresh access token once the original access token has expired.

The credentials being returned by the plugin include the access token, an expiration for the access token (looks to be 1 hour from now by default) and a refresh token.

What I'd like to be able to do is make a call like this:

http://example.com/oauth/request_access?refresh_token=the_refresh_token

And get back a new access token and a new expiration date, along with the typical user metadata/info hash. Is that possible with the current plugin or would this need to be built?

Regenerate secret ability.

It would be a good idea to add a regenerate secrets on demand from the admin. Currently, an admin would have to delete and re add a client.

/oauth/request_access returns null

I've successfully called /oauth/authorize and /oauth/request_token, but when I call /oauth/request_access with a valid access token, I receive a single string in the response body: "null"

Obviously something is wrong. Any ideas?

/oauth/request_access/ require trail slash

It is required to add a trailing slash to the request_access method.
The plugin does return a redirect to the correct URL but in the default nodeJS library I use (passport) the http client does not follow redirect by default.

I'm not sure what is more correct - with or without slash.

`expires_in` being returned as a string in `/oauth/token`

We're running 3.1.93 with Wordpress 4.4.1. When setting a custom expiry time in the admin interface the expires_in parameter is returned as a string, not a number. E.g.:

{
  "access_token": "abc123",
  "expires_in": "86400",
  "token_type": "Bearer",
  "scope": "basic",
  "refresh_token": "def456"
}

If you remove the custom value for expiry time then you get expires_in correctly as an int, e.g.

{
  "access_token": "abc123",
  "expires_in": 3600,
  "token_type": "Bearer",
  "scope": "basic",
  "refresh_token": "def456"
}

400 Response when Access Token in Header

I'm able to successfully retrieve an access token using this plugin but when I wish to attach it to an API requests (say /oauth/me/) it only appears to work when the access token is a parameter, rather than a header.

If I hit http://54.253.241.207/oauth/me/?access_token=XXXXXXXXXX the requests returns successfully. Yet when I use the 'Authorization: Bearer XXXXXX' header I get a 400 response with the response {error: "invalid_request", error_description: "Missing or invalid parameter(s)"}.

Am I right to think that authentication using the 'Authorization' header should still work in the free version of the plugin?

Full Gist of the cURL response is here and the header definitely seems to be present.

Thanks for any help.

Line ~77 of /includes/profile.php on

This query should be reworked to:

$query = "DELETE FROM {$wpdb->prefix}oauth_access_tokens WHERE user_id = %d AND ap_generated = %d";
$query = $wpdb->prepare( $query, $user_id, 1 );
$wpdb->query( $query );

It is VERY important to use the prepare() method. I am not going to put further reviews about it. You should check the plugin throughout and refactor.

Second signature doesn't need a variable

Change

function wp_ap_generate_access_token() {
$token_length = wo_setting( 'token_length' );

return strtolower( wp_generate_password( $token_length, FALSE, $extra_special_chars = FALSE ) );

}

To:

function wp_ap_generate_access_token() {
$token_length = wo_setting( 'token_length' );

return strtolower( wp_generate_password( $token_length, FALSE, FALSE ) );

}

wordpress plugin update receives an stdclass instead of an array

To reproduce:

  • WP 4.8.2
  • this plugin version 3.4.1
  • update available: 3.4.2
  1. go to plugins
  2. find the plugin in the list with an update available
  3. click the 'show details' link
  4. observe that nothing happens
  5. and that you have a fatal error:
[14-Nov-2017 13:29:22 UTC] PHP Fatal error:  Uncaught Error: Cannot use object of type stdClass as array in /Users/javorszky/Sites/hb/wp-admin/includes/plugin-install.php:501
Stack trace:
#0 /Users/javorszky/Sites/hb/wp-includes/class-wp-hook.php(298): install_plugin_information('')
#1 /Users/javorszky/Sites/hb/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array)
#2 /Users/javorszky/Sites/hb/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
#3 /Users/javorszky/Sites/hb/wp-admin/plugin-install.php(67): do_action('install_plugins...')
#4 /Users/javorszky/.composer/vendor/laravel/valet/server.php(133): require('/Users/javorszk...')
#5 {main}
  thrown in /Users/javorszky/Sites/hb/wp-admin/includes/plugin-install.php on line 501

400 Cannot Post at oauth/token

I am authenticating through Wordpress using Electron and the setup for my test site works, but the production site gives a 400 cannot post at oauth/token. The call to oauth/code works, but oauth/token does not. The only difference I can see from the WP Oauth Server is the Running CGI says, "Header 'Authorization Basic' may not work as expected". I can't seem to find anything in the documentation on what causes this or even referencing the Running CGI or what this description could even mean. Something on Wordpress must trigger it, but it's a mystery as to what does.

Not working for me

Hi Justin,

I installed the plugin in clean wordpress 3.9 installation following the instructions but the URLs (e.g. /oauth/authorize) are not working. One "page not found" is shown.
Is there any additional step I have to do?

Thanks.

Integration with WP-API ?

Hi there,

I was wondering if your plugin can be integrated with http://wp-api.org/ ?

For example, after performing the authentication, I will have the user data and the access token.

How do i use this access token and perform GET/POST requests ?

So if your plugin can be integrated with http://wp-api.org, how should I go about doing it ?

If not, I was wondering how do i extend your plugin to include JSON apis in a similar fashion as wp-api ?

Thanks a lot, great work!

How to login after app close with access_token

First at all, congratulations for your works.

I have an app that takes all the procedure and it works perfect. I store the access_token. After closing the application, I can request_access, because I have the access_token from the previous user, and get the result perfectly, but user is not login, so I when I try then to do something else, I always have a 401 response. How can I login if I have the access_token?

how to set the rewrite rules for nginx?

when i open
/oauth/authorize?response_type=code&client_id=TestClient&redirect_uri=https:/redirect-uri.com/cb/

it turns into
/oauth/authorize/?response_type=code&client_id=TestClient&redirect_uri=https:/redirect-uri.com/cb/

then the wordpress show me the index page instead of the json i want.

what should I do?

Internationalization

In some places, you have internationalization in place. Like /includes/admin-options.php line 48:

	add_submenu_page( 'wo_manage_clients', 'Clients', __( 'Clients', 'wp-oauth' ), 'manage_options', 'wo_manage_clients', 'wo_admin_manage_clients_page' );

See how you have:

__( 'Clients', 'wp-oauth' )

That needs done throughout the entire project in ALL files. For example /includes/admin/pages/edit-client.php line 145:

                                <h3>Advanced Options</h3>

Should be:

                                <h3><?php echo __('Advanced Options', 'wp-oauth'); ?></h3>

Authenticate just using client id ? ( no need for client secret ) ?

Hi good day,

firstly, great work and I managed to get your plugin working quickly and easily together with your sample php client.

I was wondering if there is anyway to perform authentication without the use of client secret ?
I got this inspiration by looking at Facebook's JS SDK, where authorization does not require a client secret, but just a client id will do. What i intend to do is to write a simply javascript client that can perform the authentication in a similar fashion as what we see in Facebook.

So can this be done ? ( authenticating without the use of client secret )

Thanks!

Documentation request

Forgive me if this is already in your documentation, but I haven't found it: I think it'd be very helpful to have a few example debugging URLs which would allow me to identify the form of key requests, and, for example, see the form of the JSON for a user object... It might also be useful to show an example of the JSON for an authenticated user object to help with the process of mapping fields for clients.

Oauth redirecting to /login/

Mostly due to some extra plugin.
The authorization endpoint redirects to /login/
Any clues on what could be the issue ?

Unable to navigate to /.well-known/openid-configuration/

I have been unable to get /.well-known/openid-configuration/ to show up. I get a 404 not found when going there.

I believe this is preventing me from using AuthSession.useAutoDiscovery() with Expo. It didn’t work with the free version. So I purchased it and enabled OpenID Connect.

Still not working.

Password Grant authorization not working as expected

I am trying to utilize the password-grant authorization, but all attempts to send form data get discarded and in my response, I'm being forwarded to a login form (though I can see some of my form data in my request header).

My preference is to handle the login process on the front-end and just encrypt the transmission. How can I avoid the redirect to the login form?

Logout method for the API

Since the login creates a session on the Wordpress site, I believe, there should be a method logout within the oAuth API that gives as a response a logout url. For example:

Request:
http://yourdomain.com/oauth/logout?access_token=6f6d8a22c3b127034fb8dc137766625268631d0b

Response:
{"logout_url":"http://yourdomain.com/wp-login.php?action=logout&redirect_to=http://oauthclientsite.com&_wpnonce=5a919040d6"}

Not sure about other users, but I needed it on my site so I had to make changes to the plugin to achieve this since building a different plugin that reuses the classes defined on your plugin was going to be harder.

Any plans for creating a Resource API that integrates with the oAuth server?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.