Enable basic authentication [1 
<http://www.web2py.com/books/default/chapter/29/09/access-control#Access-Control-and-Basic-Authentication>
]:

auth.settings.allow_basic_login = True


so:

https://user:password@http://localhost:8080/mysite/controller/get_example




[1] 
http://www.web2py.com/books/default/chapter/29/09/access-control#Access-Control-and-Basic-Authentication








Em sexta-feira, 2 de outubro de 2015 18:06:25 UTC-3, Fábio Filho escreveu:
>
> I'm sorry by my english....
>
> How can i connect my android application in my web2py site using auth 
> authentication (@auth.requires_login)?
>
> I need make a secure connection between them
>
> for example: 
>
>
> Web2Py Side :
>
> @auth.requires_login()
> def get_examplet():
>     return "{'code':'0'}"
>
>
>
>
> Android Java side: 
>
> new Thread(){
>       
>       @Override
>       public void run(){
>                   
>             Http.request("localhost:8080/mysite/controller/get_example") ; 
>  //  <---- i got a refused connection because that python line code 
> ("@auth.requires_login()"),
>                                                                           
>                              //        so of course that is expected 
> because i need to be logged in to make this request           
>                                                                           
>                              //     when a remove that python line code 
> above ("@auth.requires_login()"), i take it perfectly .... 
>
>        }
>
> }.start();
>
>
>
> How can i do this above? 
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to