hi,
i'm using pyramid with repoze.who via pyrfamid_who. Now I'd like to
integrate basic authentication but it seems the challenger (i.e.
creation of a HTTP 401 response) isn't done. I could get the desired
behaviour by registering the following view for the forbidden context:
def challenge_view(request):
authn_policy =
request.registry.queryUtility(IAuthenticationPolicy)
if authn_policy is not None:
api = authn_policy._getAPI(request)
challenge_app = api.challenge()
if challenge_app is not None:
return request.get_response(challenge_app)
return Response("<h1>Forbidden</h1>", status="403 Forbidden")
# pragma: no cover
but I'm somewhat hesitant calling _getAPI, because the leading
underscore seems to indicate I shouldn't do so. What is the
recommended way to get at the repoze.who.api instance?
regards
robert
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.