mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 12:09:20 +03:00
Use SNAPPYMAIL_INCLUDE_AS_API and added SSO test
This commit is contained in:
parent
dd6779b1a8
commit
7f084dda53
4 changed files with 29 additions and 8 deletions
21
test/sso.php
Normal file
21
test/sso.php
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
// Enable SnappyMail Api and include index file
|
||||
$_ENV['SNAPPYMAIL_INCLUDE_AS_API'] = true;
|
||||
require '../index.php';
|
||||
|
||||
/**
|
||||
* Get SSO hash
|
||||
*/
|
||||
$aAdditionalOptions = array(
|
||||
// One of /snappymail/v/0.0.0/app/localization/*
|
||||
// 'Language' = 'en-US'
|
||||
);
|
||||
$bUseTimeout = true; // 10 seconds
|
||||
$ssoHash = \RainLoop\Api::CreateUserSsoHash($sEmail, $sPassword, $aAdditionalOptions, $bUseTimeout);
|
||||
|
||||
// redirect to webmail sso url
|
||||
\header('Location: https://yourdomain.com/snappymail/?sso&hash='.$ssoHash);
|
||||
|
||||
// Destroy the SSO hash
|
||||
//\RainLoop\Api::ClearUserSsoHash($ssoHash);
|
||||
Loading…
Add table
Add a link
Reference in a new issue