This commit is contained in:
Janis Steiner
2024-12-27 20:36:53 +01:00
2 changed files with 82 additions and 2 deletions

20
LICENSE.md Normal file
View File

@@ -0,0 +1,20 @@
# Jakach Open Source License
**Copyright (c) Janis Steiner**
### 1. Grant of License
You are hereby granted permission to use, copy, modify, and distribute the source code of this project (the "Software") under the following conditions:
### 2. Attribution
- You must provide appropriate credit, a link to the original source, and indicate if changes were made.
- You may not use the name of the author or contributors without explicit permission.
### 3. Non-Commercial Use
- You may not use the Software for commercial purposes. Commercial use refers to any use that is intended for or directed toward commercial advantage or monetary compensation.
- Only the author of the Software has the right to commercialize it or use it for commercial purposes.
### 4. Distribution
- You may distribute copies of the Software and any derivative works, provided that the same conditions as this license are met.
### 5. No Warranty
- The Software is provided "as-is," without warranty of any kind, either express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, or non-infringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability arising from the use of the Software.

View File

@@ -1,2 +1,62 @@
# jakach-login # Jakach Login
new (future) open source login system of jakach
**The new (future) open-source login system for Jakach**
Jakach Login offers an easy and secure way to access all Jakach services, including **jakach.duckdns.org**, **app.ksw3d.ch**, and more. It simplifies the login process by enabling users to log in with passwords, passkeys, and two-factor authentication (2FA) for enhanced security.
Jakach Login operates on its own authentication server. Any app utilizing Jakach Login must be able to communicate with this server via API requests.
---
## Usage
Using Jakach Login is straightforward:
1. **Clone the repository:**
```bash
git clone https://github.com/jakani24/jakach-login
```
2. **Create the `certs/` folder and set up SSL certificates:**
```bash
mkdir certs/
```
- Generate certificates (e.g., using [Let's Encrypt](https://letsencrypt.org/getting-started/#with-shell-access)).
3. **Create a Docker volume for database storage:**
```bash
docker volume create jakach-login-db-storage
```
4. **Run the system using Docker Compose:**
```bash
docker-compose up
```
---
## Integrating Jakach Login into Your App
To integrate Jakach Login into your application:
1. **Refer to the sample authentication plugin:**
- Locate the file `/app-code/plugins/auth.php`. This file serves as an example for adding Jakach Login to your app.
- Modify it to include your database connection and any necessary logic to load service-specific data after authentication.
2. **Account for dynamic usernames:**
- Note that the "username" provided by Jakach Login may change over time.
- The "user_token" is immutable. It's recommended to add a `user_token` column in your service's database and use it for data retrieval.
3. **Example SQL query:**
After a user is authenticated through Jakach Login, you can retrieve their data in your own local db using a statement like:
```sql
SELECT * FROM users WHERE user_token = {user token from Jakach Login server};
```
4. **Add login button:**
In your app/login page add a button like:
```html
<a href="https://jakach.duckdns.org:444/?send_to=<your url/place of your oauth file>" class="btn btn-secondary">Log in using Jakach login</a>
```
---
Jakach Login is used at [system0](https://github.com/jakani24/system0) You can also check the implementation as an example. [system0/oauth](https://github.com/jakani24/system0-2.0/blob/main/sys0-code/login/oauth.php)
For more details, explore the repository at [GitHub - Jakach Login](https://github.com/jakani24/jakach-login).