FYI automatic is on pypi now... https://pypi.org/project/Authomatic/


On Sunday, February 2, 2020 at 11:32:55 PM UTC-8, Kevin Keller wrote:
>
> Happy to support with the oidc/oauth2.
>
> Will share some code suggestions if that's ok with you
>
> On Mon, 3 Feb 2020, 05:56 Massimo Di Pierro, <massimo...@gmail.com 
> <javascript:>> wrote:
>
>> mtable is in scope and usable. Does not supprt yet fields of 
>> list:<something> type.
>>
>> Do not have a simple answer about OIDC/Oauth2 but I will try do it and 
>> post findings. :-)
>>
>> On Sunday, 2 February 2020 03:43:40 UTC-8, Kevin Keller wrote:
>>>
>>> Hey,
>>>
>>> Regarding the now code .
>>>
>>> I think its awesome. 
>>>
>>> Immediate question is though, how I could replace py4web build in auth 
>>> with an outside IDM using OIDC/Oauth2? 
>>> I understand since Py4web is so modular now, I can figure it out myself 
>>> with 3rd party components. 
>>> But I think it would be a common use case and it would be great to just 
>>> be able to define an external auth server, client secret and id and secret 
>>> in a json file and just use 
>>> the build in py4web decorators no?
>>>
>>> Apart from that, unrelated to this, just to confirm.. mtable is gone or 
>>> is it still usable.. in scope going forward? 
>>>
>>> Thanks! 
>>>
>>>
>>>
>>> On Sat, Feb 1, 2020 at 5:55 AM Massimo Di Pierro <massimo...@gmail.com 
>>> <javascript:>> wrote:
>>>
>>>> I committed some new code to py4web
>>>>
>>>> Now you can do:
>>>>
>>>> from . common import authenticated, unauthenticated # from latest 
>>>> _scaffold
>>>>
>>>> # exposes index as /{app_name}/index and uses index.html or 
>>>> generic.html template, auth.user, db, T, session
>>>> @authenticated()
>>>> def index():
>>>>       return dict()
>>>>
>>>> # GET only
>>>> @authenticated.get()
>>>> def index():
>>>>       return dict()
>>>>
>>>> # exposes /{app_name}/index/<a>/<b>/<c>
>>>> @authenticated.get()
>>>> def index(a,b,c):
>>>>       return dict()
>>>>
>>>> # more explicit
>>>> @authenticated.get("index/<a:int>/<b:int>/<c:re:.*>)
>>>> def index(a,b,c):
>>>>       return dict()
>>>>
>>>> Some magic
>>>>
>>>> # define a button that make the following serverside POST callback
>>>> @unauthenticated.button("click me")
>>>> def a_button(msg):
>>>>     print("you clicked the button and server received:", msg)
>>>>
>>>> # expose a page that displays the button which - onclick - makes the 
>>>> ballback
>>>> @unauthenticated.get()
>>>> def show_a_button():
>>>>     return dict(mybutton = a_button(msg="hello world"))
>>>>
>>>> Thoughts? Should we keep this API? Can we improve it?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> -- 
>>>> 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 web...@googlegroups.com <javascript:>.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/web2py/9261e53e-d45b-4be1-82e8-2d19a488df78%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/web2py/9261e53e-d45b-4be1-82e8-2d19a488df78%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>> 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 web...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/319c1f7d-7422-48e5-9cda-df141e2482e8%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/web2py/319c1f7d-7422-48e5-9cda-df141e2482e8%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/8304a878-7b83-4d61-a1bf-c2150bad0058%40googlegroups.com.

Reply via email to