mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
test kerberos sso with "save ticket in memory" enabled
This commit is contained in:
parent
c1ce4fbb2f
commit
8cfc847166
2 changed files with 55 additions and 0 deletions
32
.github/workflows/ci.yaml
vendored
32
.github/workflows/ci.yaml
vendored
|
|
@ -203,6 +203,38 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
docker logs apache
|
docker logs apache
|
||||||
|
|
||||||
|
kerberos-sso-memory:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
name: Kerberos SSO tests - Save ticket in memory
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: 8.0
|
||||||
|
- name: Composer
|
||||||
|
run: composer install
|
||||||
|
- name: Pull images
|
||||||
|
run: |
|
||||||
|
docker pull icewind1991/samba-krb-test-dc
|
||||||
|
docker pull icewind1991/samba-krb-test-apache
|
||||||
|
docker pull icewind1991/samba-krb-test-client
|
||||||
|
- name: Setup AD-DC
|
||||||
|
run: |
|
||||||
|
tests/setup-krb.sh
|
||||||
|
- name: Test kerberos auth
|
||||||
|
run: |
|
||||||
|
DC_IP=$(docker inspect dc --format '{{.NetworkSettings.IPAddress}}')
|
||||||
|
LIST=$(docker run --rm --name client -v /tmp/shared:/shared --dns $DC_IP --hostname client.domain.test icewind1991/samba-krb-test-client \
|
||||||
|
curl -s --negotiate -u testuser@DOMAIN.TEST: --delegation always http://httpd.domain.test/example-apache-kerberos-memory.php)
|
||||||
|
echo $LIST
|
||||||
|
LIST=$(echo $LIST | tr -d '[:space:]')
|
||||||
|
[[ $LIST == "test.txt" ]]
|
||||||
|
- name: Apache logs
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
docker logs apache
|
||||||
|
|
||||||
static-psalm-analysis:
|
static-psalm-analysis:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Psalm static analysis
|
name: Psalm static analysis
|
||||||
|
|
|
||||||
23
example-apache-kerberos-memory.php
Normal file
23
example-apache-kerberos-memory.php
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
require('vendor/autoload.php');
|
||||||
|
|
||||||
|
if (php_sapi_name() == "cli") {
|
||||||
|
echo "Note: this example shouldn't be called from cli as it expects apache to setup the keberos ticket\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
// dfs paths not working
|
||||||
|
$host = 'krb.domain.test';
|
||||||
|
$share = 'netlogon';
|
||||||
|
|
||||||
|
$auth = new \Icewind\SMB\KerberosApacheAuth(true);
|
||||||
|
$serverFactory = new \Icewind\SMB\ServerFactory();
|
||||||
|
|
||||||
|
$server = $serverFactory->createServer($host, $auth);
|
||||||
|
|
||||||
|
$share = $server->getShare($share);
|
||||||
|
|
||||||
|
$files = $share->dir('/');
|
||||||
|
foreach ($files as $file) {
|
||||||
|
echo $file->getName() . "\n";
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue