Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There are some situtation, need to invoke hook boot before serving cache content. Especially i need to check if a user with token has access to see that page and after that serve the page or not.
Need to invoke hook boot on authcache builtin before the cached content.
Comments
Comment #1
znerol CreditAttribution: znerol commentedPlease provide some more information on the specific use case. Especially give some pointers to the modules/methods used to implement token authentication and also whether or not this applies to standard pages (like
node/X
) or whether this is about Drupal used as an API (e.g. REST). Also is this site attempting to control access (via token) for anonymous users or for authenticated ones?Comment #2
pdendis CreditAttribution: pdendis commentedEspecially i am trying to authenticate a user via web service of other domain, using curl http request. I have a url callback which implements that functionality. The web service responds with a user id, then i try to check if i have a user mapped with that user id. If the user exists then gets authenticated else needs to be created.
After this process i leave authentication url callback and redirect him to node page, which is cached (authcache) per user role. The problem is, if another user has created the cached version of the page the hook boot is not invoked. I need hook boot, to limit the accessibility of the node page( using session and cookies).
I don't want a user to type node/xxx and browse the page, but first to visit /auth url(authnetication url callback) and after node page. I also need the node page if a user visit it to be cached.
Comment #3
znerol CreditAttribution: znerol commentedDo you also have substantial anonymous traffic or is this site mainly used by authenticated users?
Comment #4
pdendis CreditAttribution: pdendis commentedIt is used by authenticated, it's commerce site
Comment #5
znerol CreditAttribution: znerol commentedIn this case I recommend to disable authcache for anonymous users. I expect that this will solve the problem.
Comment #6
znerol CreditAttribution: znerol commentedPlease only reopen if you are the author of this support request. Otherwise open a new support request.