Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9235525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:04:00+00:00 2026-06-18T07:04:00+00:00

In a given BrowserView I need to login as a member. This view is

  • 0

In a given BrowserView I need to login as a member. This view is actually a webservice for members only. I extract the username and password from the request XML and I need to authenticate as this member.

So far, I’ve found the method :

self.portal.acl_users.authenticate(user, password, self.portal.REQUEST)

But this method only returns the member object (if the user and password are correct). It does not perform the authentication. I confirm this by executing :

from AccessControl import getSecurityManager
getSecurityManager().getUser() #Get the current authenticated user
>>>Anonymous User

I would like to know how can I authenticate as this member in this BrowserView.

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:04:02+00:00Added an answer on June 18, 2026 at 7:04 am

    I’d create a new security manager for such a job, after authentication:

    from AccessControl.SecurityManagement import newSecurityManager
    from AccessControl.SecurityManagement import getSecurityManager
    
    uf = self.portal.acl_users
    if not uf.authenticate(user, password, self.request):
        # Unauthorized, better raise a 401 here.
    
    smanager = getSecurityManager()
    user = uf.getUserById(user)
    if not hasattr(user, 'aq_base'):
        user = user.__of__(uf) # acquisition wrap the user
    newSecurityManager(self.request, user)
    
    # Do anything the new user should be able to do
    
    setSecurityManager(smanager)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given my two db tables aliases and subscriber have entries like this: aliases.username =
Given this method to work on a HTML page in a webbrowser: bool semaphoreForDocCompletedEvent;
Given this HTML code: <select id=menu> <option>hi</option> <option>bye</option> </select> This jQuery code: $(#menu option).first().attr(value)
Given a java class with two methods (taken from mockito): OngoingStubbing<T> thenReturn(T value); OngoingStubbing<T>
Given this CSS: #gbox_MyGrid .s-ico span { display:none; } How would one apply this
Given the following code from a Microsoft example: public class EngineMeasurementCollection : Collection<EngineMeasurement> {
Given the string below: string str = 1,2,3; Will this be the best extension
Given this xml <Documents> <Section> <SectionName>Green</SectionName> <Document> <FileName>Tier 1 Schedules</FileName> </Document> <Document> <FileName>Tier 3
Given the following HTML fragment: <form id=aspnetForm onsubmit=alert('On Submit Run!'); return true;> I need
Given this schema: Fruits - FruitID INT PK - FruitName NVARCHAR(30) - FruitStatusID INT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.