Download the PHP package redmix0901/oauth2-client-sso without Composer

On this page you can find all versions of the php package redmix0901/oauth2-client-sso. 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 oauth2-client-sso

Cài đặt

Cài đặt qua composer

publish file config vào thư mục config

Sử dụng

middleware này sẽ luôn làm mới access token khi hết hạn.

Nếu bạn muốn redirect về trang Auth Server để đăng nhập nếu user chưa đăng thì thêm redirect phía sau.

Nếu muốn token được gắn trên cookie, để gọi xác thực api thì thêm cookie

Hoặc bạn có thể kết hợp cả 2:

Nếu cần xác thực Token của user từ Resource Server lên (Auth Server) id.todpev.vn thì dùng guard và config trong file config/auth.php như sau

Việc xác thực API sẽ có 2 trường hợp:

middleware này sẽ gắn token vào cookie và server sẽ kiểm tra token đó để xác thực.

-Trong trường hợp sử dụng Single page application, khi token trên cookie hết hạn bạn có thể gọi request /oauth2/issueToken để được cấp phát token mới. Nếu có lỗi, hết hạn hoặc bị logout thì sẽ trả về message sau:

Chỉnh sửa config như sau:

defaults là không bắt buộc. Nếu không chỉnh sửa defaults thì bạn có thể dùng auth()->guard('oauth2')->user()

Nếu muốn lấy thông tin user từ request có thể dùng cách sau.

Nếu bạn chọn config mapingUser = true.
User sẽ được tự động map với user trong database cũa App Server.

Nếu Auth Server trả về 1 user mới thì nó sẽ tự động tạo 1 user với các trường mà Auth Server trả về và được map với fillable trong model User. Việc của bạn là update thông tin cho user đó trong event:

Có thể logout bằng link sau: /oauth2/logout hoặc bằng tên route sso.logout

Có thể login bằng phương thức get link sau: /oauth2/login hoặc bằng tên sso.login.authorization_code

Login with email, password bằng phương thức post: /oauth2/login hoặc bằng tên sso.login.password_grant


All versions of oauth2-client-sso with dependencies

PHP Build Version
Package Version
Requires league/oauth2-client Version ^2.4
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 redmix0901/oauth2-client-sso contains the following files

Loading the files please wait ....