All Projects → tegaphilip → Padlock

tegaphilip / Padlock

Licence: mit
Phalcon Authentication Server

Projects that are alternatives of or similar to Padlock

Microservices Event Sourcing
Microservices Event Sourcing 是一个微服务架构的在线购物网站,使用Spring Boot、Spring Cloud、Spring Reactor、OAuth2、CQRS 构建,实现了基于Event Sourcing的最终一致性,提供了构建端到端微服务的最佳实践
Stars: ✭ 657 (+3550%)
Mutual labels:  oauth2
Springcloud
基于SpringCloud2.1的微服务开发脚手架,整合了spring-security-oauth2、nacos、feign、sentinel、springcloud-gateway等。服务治理方面引入elasticsearch、skywalking、springboot-admin、zipkin等,让项目开发快速进入业务开发,而不需过多时间花费在架构搭建上。持续更新中
Stars: ✭ 6,997 (+38772.22%)
Mutual labels:  oauth2
Pizzly
The simplest, fastest way to integrate your app with an OAuth API 😋
Stars: ✭ 796 (+4322.22%)
Mutual labels:  oauth2
Aspnet5identityserverangularimplicitflow
OpenID Connect Code / Implicit Flow with Angular and ASP.NET Core 5 IdentityServer4
Stars: ✭ 670 (+3622.22%)
Mutual labels:  oauth2
Identitymodel
.NET standard helper library for claims-based identity, OAuth 2.0 and OpenID Connect.
Stars: ✭ 693 (+3750%)
Mutual labels:  oauth2
Fw Cloud Framework
基于springcloud全家桶开发分布式框架(支持oauth2认证授权、SSO登录、统一下单、微信公众号服务、Shardingdbc分库分表、常见服务监控、链路监控、异步日志、redis缓存等功能),实现基于Vue全家桶等前后端分离项目工程
Stars: ✭ 717 (+3883.33%)
Mutual labels:  oauth2
Django Graphql Jwt
JSON Web Token (JWT) authentication for Graphene Django
Stars: ✭ 649 (+3505.56%)
Mutual labels:  oauth2
Jso
Easy to use OAuth 2.0 javascript library for use in your javascript application.
Stars: ✭ 830 (+4511.11%)
Mutual labels:  oauth2
Jose Jwt
Ultimate Javascript Object Signing and Encryption (JOSE) and JSON Web Token (JWT) Implementation for .NET and .NET Core
Stars: ✭ 692 (+3744.44%)
Mutual labels:  oauth2
Cpprestsdk
The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
Stars: ✭ 6,631 (+36738.89%)
Mutual labels:  oauth2
Yt
The reliable YouTube API Ruby client
Stars: ✭ 674 (+3644.44%)
Mutual labels:  oauth2
Spring Boot React Oauth2 Social Login Demo
Spring Boot React OAuth2 Social Login with Google, Facebook, and Github
Stars: ✭ 676 (+3655.56%)
Mutual labels:  oauth2
Incubator
Incubator adapters/functionality for the Phalcon PHP Framework
Stars: ✭ 734 (+3977.78%)
Mutual labels:  phalcon
Appauth Js
JavaScript client SDK for communicating with OAuth 2.0 and OpenID Connect providers.
Stars: ✭ 659 (+3561.11%)
Mutual labels:  oauth2
Sso
cas单点登录系统,其中包括cas认证服务,配置中心,监控平台,服务管理的高可用项目
Stars: ✭ 797 (+4327.78%)
Mutual labels:  oauth2
Rack Oauth2
OAuth 2.0 Server & Client Library. Both Bearer and MAC token type are supported.
Stars: ✭ 652 (+3522.22%)
Mutual labels:  oauth2
Jpproject.identityserver4.adminui
🔧 ASP.NET Core 3 & Angular 8 Administration Panel for 💞IdentityServer4 and ASP.NET Core Identity
Stars: ✭ 717 (+3883.33%)
Mutual labels:  oauth2
Jwtsecurity
JWT Server for Asp.Net Core and Asp.Net WebAPI2
Stars: ✭ 16 (-11.11%)
Mutual labels:  oauth2
Play Silhouette
Silhouette is an authentication library for Play Framework applications that supports several authentication methods, including OAuth1, OAuth2, OpenID, CAS, 2FA, TOTP, Credentials, Basic Authentication or custom authentication schemes.
Stars: ✭ 826 (+4488.89%)
Mutual labels:  oauth2
Auth0.js
Auth0 headless browser sdk
Stars: ✭ 755 (+4094.44%)
Mutual labels:  oauth2

Padlock, Phalcon Authentication Server

Latest Version on Packagist Software License Total Downloads

Padlock is a docker-based phalcon authentication server built on top of the PHP OAuth 2.0 Server

Setting Up

  • Add the entries padlock.local and padlock-test.local and map to 127.0.0.1 in your /etc/hosts file

  • Ensure you have docker installed

  • Make a copy of .env.sample to .env in the app/env/ directory and replace the values.

  • You can generate the ENCRYPTION_KEY environment variable by running php -r "echo base64_encode(random_bytes(40)) . PHP_EOL;" on the command line

  • cd into the keys directory and generate your public and private keys like so: openssl genrsa -out private.key 2048 then openssl rsa -in private.key -pubout -out public.key. These are needed for encrypting and decrypting tokens

  • You will need to change the permissions of the private and public keys you create in the previous step to the following: chgrp www-data -R keys Then chmod 600 keys/private.key

  • Feel free to change the port mappings in docker-compose.yml if you already have services running on ports 8899 for the phalcon app and 33066 for the mysql server

  • Run the app like this ./bin/start.sh or run docker-compose up -d

  • Login to mysql using the credentials host:127.0.0.1, username: root, password:root, port: 33066

  • Create two databases: padlock_db and padlock_test_db and import the sql file found in app/db/padlock.sql into both databases

Try it out

Requesting a Token

  1. Password Grant Flow: Send a POST request to http://padlock.local:8899/api/v1/oauth/token with the following parameters:

    • client_id: test
    • client_secret: secret
    • grant_type: password
    • username: abc
    • password: abc

    NOTE: This grant returns an access token and a refresh token

  2. Client Credentials Grant Flow: Send a POST request to http://padlock.local:8899/api/v1/oauth/token with the following parameters:

    • client_id: test
    • client_secret: secret
    • grant_type: client_credentials

    NOTE: This grant returns only an access token

  3. Refresh Token Grant: Send a POST request to http://padlock.local:8899/api/v1/oauth/token with the following parameters:

    • client_id: test
    • client_secret: secret
    • grant_type: refresh_token
    • refresh_token: value gotten from any flow that returns a refresh token (e.g password grant flow)

    NOTE: This grant returns another access token and refresh token and invalidates/revokes the previous ones

  4. Implicit Grant: Send a GET request to http://padlock.local:8899/api/v1/oauth/authorize with the following parameters:

    • client_id: test
    • response_type: token
    • state: a random string (optional)
    • redirect_uri: http://www.test.com (optional)

    NOTE: This grant returns an access token immediately. It does not return a refresh token.

  5. Authorization Code Grant: Send a GET request to http://padlock.local:8899/api/v1/oauth/authorize with the following parameters:

    • client_id: test
    • response_type: code
    • state: a random string (optional)
    • redirect_uri: http://www.test.com (optional)

    NOTE: This grant returns an authorization code that is then used to request for a token by sending a POST request to the endpoint http://padlock.local:8899/api/v1/oauth/token with the following parameters:

    • client_id: test
    • client_secret: secret
    • grant_type: authorization_code
    • code: value gotten from the get request
    • redirect_uri: http://www.test.com (optional)

Validating a Token

Send a POST request to http://padlock.local:8899/api/v1/oauth/token/validate with an Authorization header whose value is Bearer {access_token}

Running Tests

  • Make a copy of .env.sample to .env.test in the app/env/ directory and replace the values.

  • Login to the app container using ./bin/login.sh or run docker exec -it padlock_app bash

  • Execute unit tests ./unit-test.sh (uses PHPUnit)

  • Run integration tests using ./integration-test.sh (uses Codeception)

Install

Via Composer

$ composer require tegaphilip/padlock

Change log

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Credits

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].