-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from rtCamp/feature/release-1.3.1
Release 1.3.1
- Loading branch information
Showing
4 changed files
with
50 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,9 @@ | |
1. [Overview](#overview) | ||
2. [Installation](#installation) | ||
3. [Usage Instructions](#usage-instructions) | ||
|
||
[Plugin Constants](#plugin-constants) | ||
[Hooks](#hooks) | ||
|
||
4. [Shortcode](#shortcode) | ||
5. [Minimum Requirements](#minimum-requirements) | ||
|
@@ -37,19 +38,18 @@ passwords. Just one click and land into the site! | |
|
||
3. Once you create the app, you will receive the `Client ID` and `Client Secret`, add these credentials | ||
in `Settings > Login with google` settings page in their respective fields. | ||
|
||
4. `Create new user` enables new user registration irrespective of `Membership` settings in | ||
`Settings > General`; as sometimes enabling user registration can lead to lots of spam users. | ||
Plugin will take this setting as first priority and membership setting as second priority, so if | ||
any one of them is enabled, new users will be registered by this plugin after successful authorization. | ||
|
||
5. `Whitelisted Domains` allows users from specific domains (domain in email) to get registered on site. | ||
This will prevent unwanted registration on website. | ||
**For Example:** If you want users only from your organization (`myorg.com`) to get registered on the | ||
website, you enter `myorg.com` in whitelisted domains. Users with google | ||
email like `[email protected]` will be able to register on website. Contrary to this, users with emails like | ||
`[email protected]` would not be able to register here. | ||
|
||
|
||
### Plugin Constants | ||
|
||
|
@@ -65,18 +65,43 @@ Refer following list of constants. | |
| WP_GOOGLE_LOGIN_USER_REGISTRATION | Boolean | (Optional) Set True If you want to enable new user registration. By default, user registration defers to `Settings > General Settings > Membership` if constant is not set. | | ||
| WP_GOOGLE_LOGIN_WHITELIST_DOMAINS | String | (Optional) Domain name, if you want to restrict login with your custom domain. By default, It will allow all domains. You can whitelist multiple domains. | | ||
|
||
These constants can also be configured | ||
via [wp-cli](https://developer.wordpress.org/cli/commands/config/). | ||
These constants can also be configured | ||
via [wp-cli](https://developer.wordpress.org/cli/commands/config/). | ||
|
||
**Note:** If you have defined the constant in wp-config.php file, corresponding settings field will be disable | ||
(locked for editing) on the settings page. | ||
|
||
### Hooks | ||
#### Filters | ||
|
||
| Filter | Description | Parameters | | ||
| --- | ----------- | --- | | ||
| `rtcamp.google_scope` | This filter can be used to filter existing scope used in Google Sign in. <br />You can ask for additional permission while user logs in. | <ul><li>`scope` - contains array of scopes.</li></ul> | ||
| `rtcamp.google_login_modules` | Filter out active modules before modules are initialized. | <ul><li>`active_modules` - contains array of active modules.</li></ul> | ||
| `rtcamp.google_login_button_display` | This filter is useful where we want to forcefully display login button, even when user is already logged-in in system. | <ul><li>`display` - contains a boolean value of whether to display the button or not.</li></ul> | ||
| `rtcamp.google_default_redirect` | Filter the default redirect URL in case redirect_to param is not available. <br />Default to admin URL. | <ul><li>`admin_url` - contains the admin URL address which is used as redirect URL by default.</li></ul> | ||
| `rtcamp.google_register_user` | Check if we need to register the user. | <ul><li>`user` - contains the user object from google.</li></ul> | ||
| `rtcamp.google_client_args` | Filter the arguments for sending in query. <br />This is useful in cases for example: choosing the correct prompt. | <ul><li>`client_args` - contains the list of query arguments to send to Google OAuth.</li></ul> | ||
| `rtcamp.google_login_state` | Filters the state to pass to the Google API. | <ul><li>`state_data` - contains the default state data.</li></ul> | ||
| `rtcamp.default_algorithm` | Filters default algorithm for openssl signature verification | <ul><li>`default_algo` - Default algorithm.</li><li>`algo` - Algorithm from JWT header.</li></ul> | ||
|
||
#### Actions | ||
|
||
| Action | Description | Parameters | | ||
| --- | ----------- | --- | | ||
| `rtcamp.google_login_services` | Define any additional services. | <ul><li>`container` - Container object.</li></ul> | ||
| `rtcamp.google_user_authenticated` | Fires once the user has been authenticated via Google OAuth. | <ul><li>`user` - User object.</li></ul> | ||
| `rtcamp.id_token_verified` | Do something when token has been verified successfully.<br />If we are here that means ID token has been verified. | ||
| `rtcamp.google_user_logged_in` | Fires once the user has been authenticated. | <ul><li>`user_wp` - WP User data object.</li><li>`user` - User data object returned by Google.</li></ul> | ||
| `rtcamp.google_user_created` | Fires once the user has been registered successfully. | <ul><li>`uid` - User ID</li><li>`user` - WP user object.</li></ul> | ||
| `rtcamp.login_with_google_exception` | Fires when an exception is raised during token verification. | <ul><li>`exception` - The exception which is being raised.</li></ul> | ||
|
||
## Shortcode | ||
|
||
You can add the google login button to any page/post using shortcode: `google_login` | ||
You can add the google login button to any page/post using shortcode: `google_login` | ||
|
||
**Example:** | ||
```php | ||
```php | ||
[google_login button_text="Google Login" force_display="yes" /] | ||
``` | ||
|
||
|
@@ -126,9 +151,9 @@ generated at `/tmp/report/html` | |
|
||
## Minimum Requirements | ||
|
||
WordPress >= 5.4.0 | ||
WordPress >= 5.5.0 | ||
|
||
PHP >= 7.3 | ||
PHP >= 7.4 | ||
|
||
## License | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.