From: Alpár J. <al...@cs...> - 2009-11-17 10:40:24
|
I would like to use Yaws (1.84) in embedded mode with www authentication. So, I put something like authdirs = [ #auth{ dir = ["/"], realm = "xxx", users = [{"yyy","zzz"}] }], into th #sconf record. Strangely it seems working with links, but with firefox or opera it just display a "401 authentication needed" page, but does not pop-up a username/passwd prompt. Could anyone tell me where did I the mistake? Regards, Alpar |
From: Anders D. <an...@da...> - 2009-11-17 11:14:33
|
Hi, If memory serves my right, it has to do with the fact that the auth headers is not added by default in embedded mode unless the auth config is read from auth files. I can't verify the below right now, but please try: Realm = "xxx", Headers = yaws:make_www_authenticate_header({realm, Realm}), authdirs = [ #auth{ dir = ["/"], realm = Realm, users = [{"yyy","zzz"}], headers = Headers }], In 1.85 it should be possible to add something like this to your appmod: %% Used if auth/2 returns {false, X} | false %% or for unauthorized requests out401(_Arg, _Auth, Realm) -> [{status, 401}, {header, yaws:make_www_authenticate_header({realm, Realm})}]. Brgds, /Anders Alpár Jüttner wrote: > I would like to use Yaws (1.84) in embedded mode with www > authentication. So, I put something like > > authdirs = [ #auth{ dir = ["/"], > realm = "xxx", > users = [{"yyy","zzz"}] > }], > > into th #sconf record. Strangely it seems working with links, but with > firefox or opera it just display a "401 authentication needed" page, but > does not pop-up a username/passwd prompt. > > Could anyone tell me where did I the mistake? > > Regards, > Alpar > > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Erlyaws-list mailing list > Erl...@li... > https://lists.sourceforge.net/lists/listinfo/erlyaws-list |
From: Alpár J. <al...@cs...> - 2009-11-17 11:03:26
|
Hi, Thanks. This was the trick. Alpar On Tue, 2009-11-17 at 11:58 +0100, Anders Dahlin wrote: > Hi, > > If memory serves my right, it has to do with the fact that the auth > headers is not added by default in embedded mode unless the auth config > is read from auth files. I can't verify the below right now, but please try: > > Realm = "xxx", > Headers = yaws:make_www_authenticate_header({realm, Realm}), > authdirs = [ #auth{ dir = ["/"], > realm = Realm, > users = [{"yyy","zzz"}], > headers = Headers > }], > > > In 1.85 it should be possible to add something like this to your appmod: > > %% Used if auth/2 returns {false, X} | false > %% or for unauthorized requests > out401(_Arg, _Auth, Realm) -> > [{status, 401}, > {header, yaws:make_www_authenticate_header({realm, Realm})}]. > > > Brgds, > /Anders > > > Alpár Jüttner wrote: > > I would like to use Yaws (1.84) in embedded mode with www > > authentication. So, I put something like > > > > authdirs = [ #auth{ dir = ["/"], > > realm = "xxx", > > users = [{"yyy","zzz"}] > > }], > > > > into th #sconf record. Strangely it seems working with links, but with > > firefox or opera it just display a "401 authentication needed" page, but > > does not pop-up a username/passwd prompt. > > > > Could anyone tell me where did I the mistake? > > > > Regards, > > Alpar > > > > > > > > ------------------------------------------------------------------------------ > > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > > trial. Simplify your report design, integration and deployment - and focus on > > what you do best, core application coding. Discover what's new with > > Crystal Reports now. http://p.sf.net/sfu/bobj-july > > _______________________________________________ > > Erlyaws-list mailing list > > Erl...@li... > > https://lists.sourceforge.net/lists/listinfo/erlyaws-list |