Skip to content

Commit

Permalink
chore(init): initial commit
Browse files Browse the repository at this point in the history
Initial beta commit for this plugin
  • Loading branch information
nerdcel committed Jan 29, 2025
0 parents commit d100d57
Show file tree
Hide file tree
Showing 29,450 changed files with 3,122,891 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.php]
indent_size = 4

[*.md,*.txt]
trim_trailing_whitespace = false
insert_final_newline = false

[composer.json]
indent_size = 4
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# files of Composer dependencies that are not needed for the plugin
/vendor/**/.*
/vendor/**/*.json
/vendor/**/*.txt
/vendor/**/*.md
/vendor/**/*.yml
/vendor/**/*.yaml
/vendor/**/*.xml
/vendor/**/*.dist
/vendor/**/readme.php
/vendor/**/LICENSE
/vendor/**/COPYING
/vendor/**/VERSION
/vendor/**/docs/*
/vendor/**/example/*
/vendor/**/examples/*
/vendor/**/test/*
/vendor/**/tests/*
/vendor/**/php4/*
/vendor/getkirby/composer-installer
/vendor/doctrine
/vendor/myclabs
/vendor/phar-io
/vendor/phpdocumentor
/vendor/phpspec
/vendor/phpunit
/vendor/sebastian
/vendor/symfony
/vendor/theseer
/vendor/webmozart
/.cache
/.vscode
/.sqlite
/~
/.ddev
52 changes: 52 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"tagFormat": "v${version}",
"branches": [
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"releaseRules": [
{
"type": "docs",
"release": "patch"
},
{
"type": "refactor",
"release": "patch"
},
{
"type": "improvement",
"release": "patch"
}
]
},
"@semantic-release/release-notes-generator",
"@ambimax/semantic-release-composer",
"@semantic-release/github",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@ambimax/semantic-release-composer",
{
"skipOnMissingComposerJson": true
}
],
[
"@semantic-release/git",
{
"assets": [
"composer.json",
"package.json",
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
Empty file added CHANGELOG.md
Empty file.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 Marcel Hieke-Hecht

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Kirby OAuth2 Email

[![Kirby 4](https://img.shields.io/badge/kirby-4-fb654f.svg)](https://getkirby.com)
[![Release](https://img.shields.io/github/v/release/nerdcel/kirby-oauth2-email)](https://github.com/nerdcel/kirby-oauth2-email/releases)
[![License](https://img.shields.io/github/license/nerdcel/kirby-oauth2-email)](https://github.com/nerdcel/kirby-oauth2-email/blob/main/LICENSE)

This plugin is a Kirby extension that allows you to authenticate users via OAuth2 and their email address.

This plugin implements the OAuth2 flow for the following providers:
- Google
- Microsoft
- Yahoo
- Azure

## Installation

```bash
composer require nerdcel/kirby-oauth2-email
```

Or download the [latest release](https://github.com/nerdcel/kirby-oauth2-email/releases) unzip it, copy it to `site/plugins/kirby-oauth2-email`.

## Setup your OAuth2 provider

You need to configure your OAuth2 provider to allow the authentication of your users.
You need to create an OAuth2 application and get the client ID and client secret. At this point, I assume you have a basic understanding of OAuth2 and how to setup your provider.

You most likely need to provide a redirect URL, which is `https://your-site.tld/email/oauth2`.
If this step is done, you can configure the plugin using the refresh token, client ID, and client secret (tenantId e.g. Azure).
Once this is done you can configure the plugin.

## Usage

Edit your `config.php` and add the following lines:

```php
'nerdcel.kirby-oauth2-email' => [
'email' => '[email protected]',
'service' => 'azure', // google, microsoft, yahoo, azure
'client-id' => 'your-client-id',
'client-secret' => 'your-client-secret',
'tenant-id' => 'your-tenant-id', // only for azure
'refresh-token' => 'your-refresh-token', // received from the first login
]
```

After you have configured the plugin, you should be able to send emails for example using the dreamform plugin or when you use the 2FA option for the panel.

```php

## Usefull links

- [PHPMailer Wiki](https://github.com/PHPMailer/PHPMailer/wiki/)
- [Mailtrap Blog](https://mailtrap.io/blog/phpmailer-office-365/#Send-email-using-Outlook-SMTP)
42 changes: 42 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "nerdcel/kirby-oauth2-email",
"description": "Kirby Plugin to setup OAuth for SMTP Mail (e.g. Outlook, Gmail, Yahoo, etc.)",
"license": "MIT",
"type": "kirby-plugin",
"version": "0.0.1-beta-1",
"authors": [
{
"name": "Marcel Hieke",
"email": "[email protected]"
}
],
"require": {
"getkirby/composer-installer": "^1.1",
"phpmailer/phpmailer": "v6.9.2",
"decomplexity/sendoauth2": "^v4.1.0",
"ext-mbstring": "*",
"ext-openssl": "*",
"stevenmaguire/oauth2-microsoft": "^2.2.0",
"greew/oauth2-azure-provider": "^v2.0.0",
"hayageek/oauth2-yahoo": "^2.0.5",
"league/oauth2-google": "^4.0.1",
"psr/log": "^3.0.2",
"thenetworg/oauth2-azure": "^v2.2.2",
"symfony/polyfill-mbstring": "v1.31.0"
},
"require-dev": {
"getkirby/cms": "^4.5.0"
},
"config": {
"optimize-autoloader": true,
"allow-plugins": {
"getkirby/composer-installer": true
}
},
"scripts": {
"build-composer": "composer install --no-dev --optimize-autoloader",
"build-release": [
"composer install --no-dev --optimize-autoloader"
]
}
}
Loading

0 comments on commit d100d57

Please sign in to comment.