-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Oauth IMAP mail receivers for G Suite and Azure AD
- Loading branch information
1 parent
82aaa55
commit faafa8e
Showing
36 changed files
with
6,036 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
dist/ | ||
vendor/ | ||
.gh_token | ||
*.min.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
language: php | ||
php: | ||
- 7.2 | ||
- 7.4 | ||
|
||
before_script: | ||
- composer self-update | ||
- composer install --optimize-autoloader --prefer-dist --no-interaction --no-progress --no-suggest | ||
|
||
script: | ||
- vendor/bin/robo --no-interaction code:cs --strict | ||
|
||
cache: | ||
directories: | ||
- $HOME/.composer/cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Oauth IMAP client for GLPI | ||
|
||
This plugins provides IMAP SASL XOAUTH2 authentication mechanism for mail receivers. | ||
|
||
Currently implemented for: | ||
|
||
* [Google (Gmail)](https://developers.google.com/gmail/imap/xoauth2-protocol) | ||
* [Microsoft Azure (Microsoft 365)](https://docs.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth) | ||
|
||
![Configuration page](docs/screenshots/config.png) | ||
![mail receiver setup](docs/screenshots/config_oauth_mailcollector.png) | ||
|
||
## Documentation | ||
|
||
We maintain a detailed documentation here -> [Documentation](https://glpi-plugins.readthedocs.io/en/latest/oauthimap/index.html) | ||
|
||
## Contact | ||
|
||
For notices about major changes and general discussion of oauthimap, subscribe to the [/r/glpi](https://www.reddit.com/r/glpi/) subreddit. | ||
You can also chat with us via IRC in [#glpi on freenode](http://webchat.freenode.net/?channels=glpi) or [@glpi on Telegram](https://t.me/glpien). | ||
|
||
## Professional Services | ||
|
||
![GLPI Network](docs/glpi_network.png "GLPI network") | ||
|
||
The GLPI Network services are available through our [Partner's Network](http://www.teclib-edition.com/en/partners/). We provide special training, bug fixes with editor subscription, contributions for new features, and more. | ||
|
||
Obtain a personalized service experience, associated with benefits and opportunities. | ||
|
||
## Contributing | ||
|
||
* Open a ticket for each bug/feature so it can be discussed | ||
* Follow [development guidelines](http://glpi-developer-documentation.readthedocs.io/en/latest/plugins/index.html) | ||
* Refer to [GitFlow](http://git-flow.readthedocs.io/) process for branching | ||
* Work on a new branch on your own fork | ||
* Open a PR that will be reviewed by a developer | ||
|
||
## Copying | ||
|
||
* **Code**: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License ([GPL-2.0](https://www.gnu.org/licenses/gpl-2.0.en.html)). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
/** | ||
------------------------------------------------------------------------- | ||
oauthimap plugin for GLPI | ||
Copyright (C) 2018-2020 by the oauthimap Development Team. | ||
------------------------------------------------------------------------- | ||
LICENSE | ||
This file is part of oauthimap. | ||
oauthimap is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or | ||
(at your option) any later version. | ||
oauthimap is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with oauthimap. If not, see <http://www.gnu.org/licenses/>. | ||
-------------------------------------------------------------------------- | ||
*/ | ||
|
||
require_once 'vendor/autoload.php'; | ||
|
||
class RoboFile extends Glpi\Tools\RoboFile | ||
{ | ||
//Own plugin's robo stuff | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
/** | ||
------------------------------------------------------------------------- | ||
oauthimap plugin for GLPI | ||
Copyright (C) 2018-2020 by the oauthimap Development Team. | ||
------------------------------------------------------------------------- | ||
LICENSE | ||
This file is part of oauthimap. | ||
oauthimap is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or | ||
(at your option) any later version. | ||
oauthimap is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with oauthimap. If not, see <http://www.gnu.org/licenses/>. | ||
-------------------------------------------------------------------------- | ||
*/ | ||
|
||
include ("../../../inc/includes.php"); | ||
header("Content-Type: text/html; charset=UTF-8"); | ||
Html::header_nocache(); | ||
|
||
Session::checkLoginUser(); | ||
|
||
global $DB; | ||
|
||
$iterator = $DB->request( | ||
[ | ||
'FROM' => PluginOauthimapAuthorization::getTable(), | ||
'WHERE' => [ | ||
PluginOauthimapApplication::getForeignKeyField() => $_POST['application_id'] ?? null, | ||
], | ||
] | ||
); | ||
$authorizations = [ | ||
'-1' => __('Create authorization for another user', 'oauthimap') | ||
]; | ||
$value = -1; | ||
foreach ($iterator as $row) { | ||
$authorizations[$row['id']] = $row['email']; | ||
if (array_key_exists('selected', $_POST) && $row['email'] == $_POST['selected']) { | ||
$value = $row['id']; | ||
} | ||
} | ||
|
||
Dropdown::showFromArray( | ||
PluginOauthimapAuthorization::getForeignKeyField(), | ||
$authorizations, | ||
[ | ||
'display_emptychoice' => false, | ||
'value' => $value, | ||
] | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"require": { | ||
"php": "^7.2", | ||
"league/oauth2-google": "^3.0", | ||
"thenetworg/oauth2-azure": "^1.4" | ||
}, | ||
"require-dev": { | ||
"glpi-project/tools": "^0.1" | ||
}, | ||
"config": { | ||
"optimize-autoloader": true, | ||
"platform": { | ||
"php": "7.2.0" | ||
}, | ||
"sort-packages": true | ||
} | ||
} |
Oops, something went wrong.