Skip to content
Snippets Groups Projects

Refactor uw-php-security to use 'Provider' classes

Merged Andy Summers requested to merge andrew-summers/uw-php-security:provider-refactor into master
1 file
+ 4
4
Compare changes
  • Side-by-side
  • Inline
+ 4
4
@@ -2,15 +2,15 @@
uw-php-security is a PHP companion to [uw-spring-security](https://git.doit.wisc.edu/adi-ia/uw-spring-security) for Java. Its purpose is to ease development of PHP applications needing details about UW users provided through Shibboleth.
Like uw-spring-security, uw-php-security provides a class called `UWUserDetails` for easily accessing common UW user attributes. This model is provided to applications through a `UserDetailsService`, and uw-php-security provides implementations suitable for both local and preauth (Shibboleth) environments.
Like uw-spring-security, uw-php-security provides a class called `UWUserDetails` for easily accessing common UW user attributes. This model is provided to applications through a `UserDetailsProvider`, and uw-php-security provides implementations suitable for both local and preauth (Shibboleth) environments.
```php
<?php
use edu\wisc\doit\PreauthUserDetailsService; // or LocalUserDetailsService for local development
use edu\wisc\doit\PreauthUserDetailsProvider; // or LocalUserDetailsProvider for local development
...
$userDetailsService = new PreauthUserDetailsService();
$user = $userDetailsService->loadUser();
$userDetailsProvider = new PreauthUserDetailsProvider();
$user = $userDetailsProvider->loadUser();
if ($user == null) {
// handle error
}
Loading