Comments (6)
I am the one who wrote this. I initially had an identity callable where we you could choose what to return from the adapter. But we decided it was not the job of the adapter to choose that.
Please also note that we now have a specialized storage (https://github.com/doctrine/DoctrineModule/blob/master/src/DoctrineModule/Authentication/Storage/ObjectRepository.php) that you can use. The underlying storage is a session (but you can specify any storage you want), and this storage effectively only stores identifier (not the full object).
You can then give this storage to Zend\Authentication\AuthenticationService, thus allowing you to do $authService->getIdentity().
from doctrinemodule.
Also, please note that the factory will be removed soon (as it does not really integrate well). But you could create your own factory (here is mine, for reference : https://gist.github.com/3171588)
from doctrinemodule.
AS @bakura10 said :)
It is obvious that you don't want to serialize instances, or worse proxies, thus use the storage adapter we provide. That way, only the actual identity object is exposed, and never some identifier or something the user has to deal with by accessing an ObjectManager directly.
from doctrinemodule.
@bakura10 thanks a lot for your answer! For some reasons I didn't catch that class exists ;-) That solves my problem. I may just add that I wish that at some point but I believe at this rate of changes in zf2 it's to early for that.
from doctrinemodule.
what i'm doing wrong, when i not use storage, i get stored an __PHP_Incomplete_Class Object?
from doctrinemodule.
@mungiud that's because you're loading a proxy from serialized strings. You should always only save identifiers.
from doctrinemodule.
Related Issues (20)
- vendor/bin/doctrine-module only works if it's a symlink HOT 12
- Unit tests should be executed with PHP 8.0 HOT 1
- Pushed breaking change in 4.2 release HOT 4
- incompatible with doctrine/orm >= 2.12.0 HOT 3
- Missing Versions on Packagist HOT 2
- Deprecate doctrine/cache HOT 8
- Release 5.3.0 with PHP 8.2 Support HOT 5
- Can't install due to conflicting requirements HOT 25
- Current CLI implementation triggers api-tools-mvc-auth events HOT 2
- 6.0.2 regex change is too restrictive HOT 6
- Missing requirement in composer.json HOT 2
- Migration to v6 leads to cache issues HOT 11
- Authentication Error when no credentialCallable is given. HOT 5
- Allow cleanSearchValue method to accept an integer HOT 4
- Mapping error doctrine find, findOneBy, findBy. HOT 1
- Package incorrectly states that it does provide `laminas/laminas-cache-storage-implementation` HOT 3
- Bump to PHP 8.3 ? HOT 3
- orm3 compatibility HOT 1
- Implement CacheItemPoolInterface
- Upgrade to ServiceManager 4 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from doctrinemodule.