All Projects → robisim74 → angular-openid-connect-php

robisim74 / angular-openid-connect-php

Licence: MIT license
Angular & PHP CodeIgniter server through OAuth 2.0 OpenID Connect

Programming Languages

PHP
23972 projects - #3 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to angular-openid-connect-php

Validate.js
Lightweight JavaScript form validation library inspired by CodeIgniter.
Stars: ✭ 2,540 (+18042.86%)
Mutual labels:  codeigniter
sistem skripsi
Proses skripsi menjadi lebih teratur dan cepat yang dilakukan secara online yang bisa diakses dimana saja melalui browser dengan bertujuan menghemat waktu, tenaga dan memudahkan mendapatkan informasi proses skripsi secara Online.
Stars: ✭ 23 (+64.29%)
Mutual labels:  codeigniter
auth-backends
Custom authentication backends and views for edX services
Stars: ✭ 20 (+42.86%)
Mutual labels:  openid-connect
Cms
News Management System Written In PHP
Stars: ✭ 245 (+1650%)
Mutual labels:  codeigniter
node-jose-tools
Command line tools for node-jose's features
Stars: ✭ 29 (+107.14%)
Mutual labels:  openid-connect
Multitenancy-Microservice-FederatedIdentity-Example
Multitenancy Federated Identity Example ASP.NET MVC C#
Stars: ✭ 33 (+135.71%)
Mutual labels:  openid-connect
Learnify
👨🏻‍🏫 — Web Edukasi Open-Source yang dibuat oleh SYAUQIZAIDAN KHAIRAN KHALAF. Learnify adalah Web edukasi yang dilengkapi video, materi dan sistem ujian yang tersedia secara gratis. Learnify dibuat ditujukan agar para siswa dan guru dapat terus belajar dan mengajar dimana saja dan kapan saja.
Stars: ✭ 199 (+1321.43%)
Mutual labels:  codeigniter
sotsera.blazor.oidc
OpenID Connect client for Blazor client-side projects
Stars: ✭ 21 (+50%)
Mutual labels:  openid-connect
Web
Source Code of www.codeigniter.org.tw
Stars: ✭ 13 (-7.14%)
Mutual labels:  codeigniter
Adware-ads-network-server
Online Advertising Network Server
Stars: ✭ 44 (+214.29%)
Mutual labels:  codeigniter
Admin Panel User Management Using Codeigniter
Admin Panel User Management Demo - CodeIgniter + AdminLTE Theme
Stars: ✭ 250 (+1685.71%)
Mutual labels:  codeigniter
undertow-pac4j
Security library for Undertow: OAuth, CAS, SAML, OpenID Connect, LDAP, JWT...
Stars: ✭ 35 (+150%)
Mutual labels:  openid-connect
oidc-client-bound-assertions-spec
An extension of OpenID Connect for credential issuance
Stars: ✭ 13 (-7.14%)
Mutual labels:  openid-connect
Codeigniter Phpmailer
A CodeIgniter 3 compatible email-library powered by PHPMailer
Stars: ✭ 239 (+1607.14%)
Mutual labels:  codeigniter
CodeIgniter-HMVC
CodeIgniter 3.1.10 with Modular Extensions - HMVC and Whoops Error Handling Framework 2.5.0
Stars: ✭ 30 (+114.29%)
Mutual labels:  codeigniter
Vue Questionnaire
使用 Vue + CI 开发的简易问卷调查系统,演示账户:admin / admin
Stars: ✭ 220 (+1471.43%)
Mutual labels:  codeigniter
AspNetCore6Experiments
ASP.NET Core Blazor BFF with Azure AD and Razor page
Stars: ✭ 43 (+207.14%)
Mutual labels:  openid-connect
Codeigniter-4-CRUD-generator
ADEL CCG is an easy open-source intuitive web app to create AdminLTE4 -Bootstrap 5- dashboards with CRUD operations in php.
Stars: ✭ 87 (+521.43%)
Mutual labels:  codeigniter
cszcms
Open Source CMS (Content Management System) with Codeigniter and Bootstrap.
Stars: ✭ 47 (+235.71%)
Mutual labels:  codeigniter
Kalkun
Open Source Web based SMS Manager
Stars: ✭ 186 (+1228.57%)
Mutual labels:  codeigniter

Angular OpenID Connect PHP

Angular v5 & PHP CodeIgniter server through OAuth 2.0 OpenID Connect. The OAuth 2.0 OpenID Connect implicit flow is implemented using angular-oauth2-oidc and OAuth 2.0 Server PHP. CodeIgniter Ion Auth 2 is used as authentication system.

Get the Changelog.

The purpose of this project is to implement a client app built with Angular that, through OAauth2 OpenID Connect implicit flow, communicates safely with an API server in PHP. The API server in this project is also the Authorization server, but they could also be on two different servers.

In the Angular app, the OIDC implicit flow is implemented using the library certified by OpenID Foundation angular-oauth2-oidc

Server side, the OIDC implicit flow is implemented using OAuth 2.0 Server PHP

As PHP framework is used CodeIgniter, and Ion Auth 2 as authentication system. The CodeIgniter extensions used are Modular Extensions - HMVC and Rest Server for the API.

However, you can adapt this implementation of OpenID Connect to other frameworks: you only need MVC pattern, routing, and authentication system: the files to be adapted are marked with an asterisk in the following structure.

Project structure

angular-client Angular app

server PHP CodeIgniter server

  • application CodeIgniter app
    • libraries
      • OAuth2_server.php OAuth 2.0 Server PHP configuration*
    • modules HMVC modules
      • admin Admin panel
      • api restServer APIs
      • connect OpenID connect endpoints*
      • well_known OpenID connect discovery document*
  • data sql files
    • ion_auth.sql Schema for Ion Auth 2
    • oauth2.sql Schema for OAuth2 Server

Architecture

The following component and sequence diagrams show the architecture and the behavior of the project.

Component diagram

OIDC-Component-diagram

Sequence diagram

OIDC-Sequence-diagram

After the user has been authorized, requests are sent through iframe and at regular intervals to Checksession endpoint to verify that the user is always logged in the Authorization server. On the expiration of the Access token (after 15 minutes in this project), a new token is automatically prompted to the Authorization server via silent renew.

Installing

  • Requirements
    • PHP version 5.6 or newer
    • MySQL (5.1+), mysqli and pdo drivers
    • Apache Module mod_rewrite enabled
    • Composer
    • Latest Node.js & npm
    • Latest Angular CLI
  • Download this project and extract it on your Apache server
  • Server
    • Create a MySQL auth_db
    • Import the sql files from data folder
    • Check the db configuration in application/config/development/database.php
    • Check the base_url configuration in application/config/development/config.php
    • Go to [path]/server/application: composer install
    • Go to [path]/server/public/assets: npm install
    • Start your server
  • Angular client
    • Optional: you can move the client wherever you want
    • Check the angular-oauth2-oidc configuration in [path]/angular-client/src/app/oauth.config.ts
    • Go to [path]/angular-client: npm install
    • Start the app: ng serve and visit http://localhost:4200

You can also access directly to the simple Admin panel on the Authorization server: http://localhost/angular-openid-connect-php/server

Initially, there is only the admin user:

Live example

A live demo of the project is also available. For convenience, both the Angular client and the PHP server are deployed on the same server (the second one is in a subdirectory).

Links

License

MIT

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].