Download the PHP package virgantara/unida-apps-support without Composer
On this page you can find all versions of the php package virgantara/unida-apps-support. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download virgantara/unida-apps-support
More information about virgantara/unida-apps-support
Files in virgantara/unida-apps-support
Package unida-apps-support
Short Description A collection of UNIDA Gontor Apps Components.
License MIT
Informations about the package unida-apps-support
๐ UNIDA Apps Support Components for Yii2
A reusable Yii2 component package for UNIDA Gontor applications. This package provides helper components for OAuth2 authentication, token handling, user session integration, and application jump support between UNIDA apps.
๐ฆ Features
- OAuth2 Authorization Code integration
- Access token and refresh token management
- User info retrieval from SSO server
- Allowed application list retrieval
- Secure app-to-app jump support
- Yii2 component-based integration
โ ๏ธ Security Notice
This package must use OAuth2 Authorization Code Flow for authentication and app jumping.
Do not send access_token or refresh_token through URL query parameters.
Bad example:
Recommended flow:
๐ Requirements
- PHP >= 7.4
- Yii2 Framework
- Composer
- OAuth2 SSO server
โ๏ธ Installation
1. Add Repository to composer.json
2. Add Package Requirement
For development branch:
For stable release tag:
Then run:
Or install directly:
๐ง OAuth Configuration
Add this configuration to params.php or params-local.php.
Example:
๐งฉ Yii2 Component Configuration
Open config/web.php, then add the components below.
๐ Start SSO Login
Add this action to your SiteController.
๐ OAuth Callback
Add this callback action to your SiteController.
Add the exception handler:
๐งญ App-to-App Jump
This package supports Google-like app jumping.
Example:
The source app should only open the target app login endpoint:
The target app will then start its own OAuth2 flow.
Correct flow:
The source application must not generate OAuth state for the target application.
๐ฑ Allowed Apps List
You can render allowed applications from SSO using:
Example usage in layout or menu:
The SSO /app/list endpoint should return data like this:
Or preferably:
๐ช Logout
Recommended logout flow:
Example:
๐ท๏ธ Release Tag Procedure
Use semantic versioning for releases.
Format:
Examples:
1. Check Current Branch
Switch to master or main branch:
or:
2. Pull Latest Changes
or:
3. Check Git Status
Make sure there are no uncommitted changes.
4. Commit Changes
Skip this step if all changes have already been committed.
5. Create Git Tag
6. Push Commit and Tag
If using master:
If using main:
Or push all tags:
7. Verify Tag
Or check remote tags:
๐ฆ Using a Release Tag in Yii2 App
After creating a release tag, update the Yii2 app composer.json.
Then run:
For a specific version:
Then:
๐ Updating Release Version
For bug fixes:
For new backward-compatible features:
For breaking changes:
๐งน Removing a Wrong Tag
Remove local tag:
Remove remote tag:
Create the corrected tag again:
๐งช Testing Package Installation Locally
In a Yii2 application:
Check installed version:
๐ Suggested Package Structure
๐งพ Example Package composer.json
If your component files are placed directly under:
then use:
โ Recommended Release Checklist
Before creating a new tag:
- [ ] Code is committed
- [ ]
composer.jsonis valid - [ ] Namespace matches PSR-4 autoload
- [ ] README is updated
- [ ] No token is exposed through URL
- [ ] OAuth callback uses authorization code
- [ ] App jump uses target app
/site/start-sso - [ ] Version tag is created
- [ ] Tag is pushed to GitHub
- [ ] Yii2 app can install the tagged version
๐ License
This package is open-sourced under the MIT license.