No it's not on-premise. They said so explicitly. Apologise for the low info 
questions. Still trying to wade through the seemingly half outdated guides. 
Finally got the Flask demo that MS provides to work so that I know the 
Azure side of things is working at least. Now have to figure out how to 
implement it in Web2Py. Is the ldap_auth method only for on premise AD?

On Wednesday, March 2, 2022 at 7:24:58 PM UTC+1 nico...@gmail.com wrote:

> Hi,
>
> do you really use Azure AD? Otherwise, for normal on-premise AD, see the 
> documentation on 
> http://web2py.com/books/default/chapter/29/09/access-control#LDAP and 
> https://github.com/web2py/web2py/blob/master/gluon/contrib/login_methods/ldap_auth.py
>
> Nico
>
>
> Il giorno mer 2 mar 2022 alle ore 16:48 urban....@gmail.com <
> urban....@gmail.com> ha scritto:
>
>> We're looking into adding AD authentication to our app. We have an active 
>> directory account and an app registered on it.
>>
>> In the documentation I found this example of enabling AD auth:
>>
>> from gluon.contrib.login_methods.ldap_auth import ldap_auth  
>> auth.settings.login_methods.append(
>>   ldap_auth( 
>>    mode='ad', 
>>    server='https://aad.portal.azure.com/',
>>    base_dn='ou=Users,dc=domain,dc=com'
>>   )
>> )
>>
>> However I get this error when trying to login
>>
>> DEBUG:web2py.auth.ldap_auth:Traceback (most recent call last):
>>   File 
>> "C:\urban\web2py_latest\web2py\gluon\contrib\login_methods\ldap_auth.py", 
>> line 236, in ldap_auth_aux
>>     con = init_ldap()
>>   File 
>> "C:\urban\web2py_latest\web2py\gluon\contrib\login_methods\ldap_auth.py", 
>> line 630, in init_ldap
>>     "ldap://"; + ldap_server + ":" + str(ldap_port))
>>   File "C:\Python27\lib\site-packages\ldap\functions.py", line 92, in 
>> initialize
>>     uri, trace_level, trace_file, trace_stack_limit, bytes_mode, **kwargs)
>>   File "C:\Python27\lib\site-packages\ldap\ldapobject.py", line 106, in 
>> __init__
>>     self._l = 
>> ldap.functions._ldap_function_call(ldap._ldap_module_lock,_ldap.initialize,uri)
>>   File "C:\Python27\lib\site-packages\ldap\functions.py", line 55, in 
>> _ldap_function_call
>>     result = func(*args,**kwargs)
>> LDAPError: (0, 'Error')
>>
>> Am I doing anything wrong on the web2py side or is the issue in the AD 
>> configuration?
>>
>> -- 
>> 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+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/7d013980-154b-4b94-9365-4a64f9e32423n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/web2py/7d013980-154b-4b94-9365-4a64f9e32423n%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/2af24944-ab26-4f5b-9f7d-966af83b8e96n%40googlegroups.com.

Reply via email to