Download the PHP package benjaminmedia/wp-wa-oauth without Composer

On this page you can find all versions of the php package benjaminmedia/wp-wa-oauth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-wa-oauth

Bonnier Publications - WordPress WhiteAlbum OAuth plugin

This plugin enables your WordPress site to integrate with the WA user base. It does it by integrating with the WA OAuth API, and giving you a set of api functions that you may call in your theme to conditionally lock content from unauthorized users.

Requirements

Installation/Configuration

Install through composer:

Download lastest release from: https://github.com/BenjaminMedia/wp-wa-oauth/releases And unzip and place in your /wp-content/plugins directory.

Getting credentials and Configuration

Once you have installed and activated the plugin then make sure that you have a set of api credentials. If you do not have a set of credentials then you should contact Bonnier to get them. You need to have a set of credentials for each domain on your site. Before credentials can be generated you must inform Bonnier of the redirect URI that should work with the credentials. This must be in the following format http://|https://[your-domain].[your-country]/wp-json/bp-wa-oauth/v1/oauth/login

Example: http://digitalfoto.dk/wp-json/bp-wa-oauth/v1/oauth/login

Other than the redirect URI you should also tell them which WA userbase you want to authenticate against ie: http://woman.dk or another WA site.

Once you have your credentials log in to your WP admin panel and go to the menu settings->Wp Wa Oauth: here you must enter each set of credentials you recieved.

Here you also have the option to Globally enable or disable the login for each domain. Furthermore you may also select a Globally required user role level.

If you have multiple languages versions of the site, make sure that you use the Polylang plugin.

If you wish specific pages to be unlocked or require another user role than the Globally set. Then you may visit the the edit page for each page/post and here you will find a meta box called: 'WA OAuth locked content'. Any setting you make here will override the Global settings you have set.

Creating local users

As of version 1.1.0 and up the plugin now supports creating local users. This means that you from the plugin settings page can toggle wether you want the plugin to create WordPress users after they have logged in.

If you enable this feature you may also choose an option whether the WordPress user should be automatically logged in to WordPress upon authenticating with WA.

Users will be given custom roles created from the roles that WA delivers: currently this amounts to two roles and . To avoid conflicts with existing WordPress roles the role names will be prefixed with meaning the final role names will be and .

Both roles will be given only the read access this, will allow users to edit/view their profile and nothing in WordPress and nothing else.

As of version 1.2.2 the plugin now hijacks already existing users that have the same email address as the logged in user from WA. The plugin will update the local user fields with the fields from the WA user.

Customizing role capabilities:

You may override the default capabilities of the roles created you should add the following filters to a plugin or your functions.php file.

Hooking into the update of local user

As of version 1.2.0 and up of the plugin you may now hook into the update call of the local user. This is done by adding a WordPress filter using the add_filter method, an example of this can be seen below:

Here is an example of the data that is returned by the Wa login service:

User update callbacks

If you have the create local users option enabled, then what might happen is that the user will update their profile on the Main WhiteAlbum site. This, could potentially mean that the local user info that your have in your application can come out of sync. In order to counter this, WhiteAlbum has a callback feature, which means they can call your application each time there is a change to a user that has been logged in to your application.

The Plugin automatically setups the callback route and will also handle the update of the user information itself, but before WhiteAlbum can call your app. They need to be informed of your callback url. The callback uri is generated from the following format: http://|https://[your-domain].[your-country]/wp-json/bp-wa-oauth/v1/oauth/callback

Example url: http://test.komputer.dk/wp-json/bp-wa-oauth/v1/oauth/callback

Your should give this url to Bonnier when requesting the credentials, then we will setup the callbacks.

Note: the callback can only work so long as your user has been logged into the application for the last 24 hours. Otherwise the local user information, will not get updated, until the next time they login to your application.

Usage Example:

The following code snippet shows an Example in php that may be used in your theme template files.


All versions of wp-wa-oauth with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package benjaminmedia/wp-wa-oauth contains the following files

Loading the files please wait ....