#19

Product support

Get help in the plugin support forum.

Categories

  • Miscellaneous
  • Security
  • Utility

This plugin provides a JSON Web Tokens authentication mechanism for OctoberCMS integrated with RainLab.User. It's essential for your web application built with Angular, Vue.js, React or other modern Javascript frameworks.

Compatibility

This plugin is compatible with the last October CMS update to Laravel 5.5.

Requirements

Theme

These plugin(s) are required for the plugin:

Configuration

You can change the security token by accessing: Settings > Users > JWTAuth Configuration
Don't forget to configure your email server by accessing: Settings > Mail > Mail Configuration

Usage

Facades

This plugin provides you two facades, JWTAuth and also JWTFactory. If you need to know more about this both Facades I recommend you to take a look at the tymondesigns/jwt-auth's wiki.

API Endpoints

Here's the list of available endpoints for this plugin.

Login

POST /api/auth/login

Parameters

Name Type Required Description
email string Yes Account email
password string Yes Account password

Responses:

SUCCESS
Code: 200
Content:

{
  token: (string),
  user: (object)
}

ERROR
Code: 401
Content:

{
  error: (object|invalid_credentials|could_not_create_token|user_inactive)
}

Register

POST /api/auth/register

Parameters

Name Type Required Description
username string Yes Account username
email string Yes Account email
password string Yes Account password
password_confirmation string No Confirm the new password

Responses:

SUCCESS
Code: 200
Content: null

ERROR
Code: 400
Content:

{
  error: (object)
}

Forgot Password

POST /api/auth/forgot_password

Parameters

Name Type Required Description
email string Yes Account email

Responses

SUCCESS
Code: 200
Content: null

ERROR
Code: 400 Content:

{
  error: (object|user_not_found)
}

Reset Password

POST /api/auth/reset_password

Parameters

Name Type Required Description
code string Yes Reset password code
password string Yes Account new password
password_confirmation string No Confirm the new password

Responses

SUCCESS
Code: 200
Content: null

ERROR
Code: 400 Content:

{
  error: (object|invalid_reset_password_code|invalid_user)
}

Account Activation

POST /api/auth/account_activation

Parameters

Name Type Required Description
activation_code string Yes Account activation code

Responses

SUCCESS
Code: 200
Content: null

ERROR
Code: 400
Content:

{
  error: (object|invalid_activation_code|invalid_user)
}
  • Found the plugin useful on 21 Nov, 2017

    JWTAuth is a great plugin! Ricardo help me a lot when I message to him.

  • Found the plugin useful on 20 Nov, 2017

    As a newcomer to OctoberCMS, this plugin saved me countless hours configuring and writing JWT into a new ecosystem. It particularly works great with Ricardo's Angular 2 theme tailored also for OctoberCMS.

    Ricardo has also been super helpful making critical updates to the plugin as system-wide version upgrades push through. I would definitely recommend this plugin.

  • author

    Replied on 21 Nov, 2017

    Hi Bill,

    Thank you very much. I'm happy that the plugin was useful. I'm always working to make great plugins.

    Anytime you need support, you can reach me by email.

    Best regards.

1.1.2

Some email URL fixes

Nov 20, 2017

1.1.1

Ads JWTAuth Facade

Nov 20, 2017

1.1.0

Settings support added

Mar 07, 2017

1.0.1

First version of JWTAuth

Feb 28, 2017