Code Monkey home page Code Monkey logo

Comments (6)

bakura10 avatar bakura10 commented on June 15, 2024

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.

bakura10 avatar bakura10 commented on June 15, 2024

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.

Ocramius avatar Ocramius commented on June 15, 2024

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.

lrodziewicz avatar lrodziewicz commented on June 15, 2024

@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.

mungiud avatar mungiud commented on June 15, 2024

what i'm doing wrong, when i not use storage, i get stored an __PHP_Incomplete_Class Object?

from doctrinemodule.

Ocramius avatar Ocramius commented on June 15, 2024

@mungiud that's because you're loading a proxy from serialized strings. You should always only save identifiers.

from doctrinemodule.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.