error create user in flat file

39 views
Skip to first unread message

agram...@gmail.com

unread,
Feb 13, 2017, 4:29:00 AM2/13/17
to privacyidea
In Privacy idea 2.17 vesrion, I ve created o local flatfile like the documentation:

pi-manage resolver create_internal test
pi-manage realm create internal_realm test

the realm was created fine but when I try to add new user I get error:
'Session' object has no attribute '_model_changes'

any Idea pls!!!!


Cornelius Kölbel

unread,
Feb 13, 2017, 5:52:47 AM2/13/17
to privacyidea
First of all you can not add users to a flatfile within privacyIDEA!

If _model_changes does not exist, please check the version of your sqlalchemy module.

agram...@gmail.com

unread,
Feb 13, 2017, 6:54:54 AM2/13/17
to privacyidea
Sorry but maybe I dont understand the concept of PI
you say than I cannot add users to flat files.
But the procedure and coresponded form to create a new user exists, what is the the purpose of this "add user" form ??
To be more specific if I dont want to inteconnect PrivacyIdea with an external database (LDAP, sql), I cannot have the option to create a user inside Privacyidea web application ??


Cornelius Kölbel

unread,
Feb 13, 2017, 9:18:38 AM2/13/17
to privacyidea
In your scenario you should use an SQL-Resolver.

The classical behaviour is to READ users from existing user sources.
To a certain extent managing users is possible - although privacyidea is no user management or identity management system.

Adding users to passwdresolvers is not possible.
If you want to add users, use an SQLresolver! This works well.

agram...@gmail.com

unread,
Feb 14, 2017, 2:36:42 AM2/14/17
to privacyidea
Thanks for your reply.
Actually we come to my initial error posting above (because also creating an sql using the instructions of the documentation comes on error) 
I ll dig your previous answer about sqlalchemy module and I will inform back
 

agram...@gmail.com

unread,
Feb 14, 2017, 5:52:22 AM2/14/17
to privacyidea
Whell I v tried (as instructed to check sqlalchemy) and i tried upgrade
pip install --upgrade sqlalchemy
upgrade was succesfull but the site stopped (tried reboot) so i restore with snapshot.

To summarize
My Goal was to be able to keep users (add, edit delete) from PrivacyIdea application
a. Tried ldap resolver, but also wanted to be able to edit/create users from privacy idea, the error was that when i tried to add user there was not password tab, so the form cames on error.

b. Tried flatfile resolver using privacyidea-create-pwidresolver-user -u user2 -i 1002 >> flatfile
i.e: /home/radusr/flatfile but also ther was no editing user capabilities

c. created an sql relolver table in pi database , but still no create user could be achieved due to error 'Session' object has no attribute '_model_changes'.

finally i tried to user the register prosedure to add new user . The error was : NoneType' object has no attribute 'add_user'

also the Privacy Idea version I m using is 2.17 is it OK ??

Cornelius Kölbel

unread,
Feb 14, 2017, 5:56:02 AM2/14/17
to priva...@googlegroups.com
a) and b) is a feature.
c) should work.

1. Please reproduce the issue and provide a debug log.
2. Operating System you are running on.
3. install method
4. pi.cfg file
> -- 
> Please read the blog post about getting help
> https://www.privacyidea.org/getting-help/.
>  
> For professional services and consultancy regarding two factor
> authentication please visit
> https://netknights.it/en/leistungen/one-time-services/
>  
> In an enterprise environment you should get a SERVICE LEVEL AGREEMENT
> which suites your needs for SECURITY, AVAILABILITY and LIABILITY:
> https://netknights.it/en/leistungen/service-level-agreements/
> --- 
> You received this message because you are subscribed to a topic in
> the Google Groups "privacyidea" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/top
> ic/privacyidea/igBZxS6pyUo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to p
> rivacyidea+...@googlegroups.com.
> To post to this group, send email to priva...@googlegroups.com.
> Visit this group at https://groups.google.com/group/privacyidea.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/privacyidea/96c560a3-6bcf-48c2-be0f-
> f9b727a5b5b9%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
Cornelius Kölbel
corneliu...@netknights.it
+49 151 2960 1417

NetKnights GmbH
http://www.netknights.it
Landgraf-Karl-Str. 19, 34131 Kassel, Germany
Tel: +49 561 3166797, Fax: +49 561 3166798

Amtsgericht Kassel, HRB 16405
Geschäftsführer: Cornelius Kölbel

signature.asc

agram...@gmail.com

unread,
Feb 14, 2017, 7:20:10 AM2/14/17
to privacyidea
# Operating system info
Description:    Ubuntu 16.04.2 LTS, Release:        16.04, Codename:       xenial
 
# Procedure followed https://media.readthedocs.org/pdf/privacyidea/latest/privacyidea.pdf  >> Section 1.2.2 Ubuntu Packages + Apache2 + Freeradius

# Pi.cfg

# The realm, where users are allowed to login as administrators
SUPERUSER_REALM = ['super']
# Your database
#SQLALCHEMY_DATABASE_URI = 'sqlite:////etc/privacyidea/data.sqlite'
# This is used to encrypt the auth_token
#SECRET_KEY = '............................'
# This is used to encrypt the admin passwords
#PI_PEPPER = ".............................."
# This is used to encrypt the token data and token passwords
PI_ENCFILE = '/etc/privacyidea/enckey'
# This is used to sign the audit log
# This is the dummy base class
#PI_AUDIT_MODULE = 'privacyidea.lib.auditmodules.base'
# This is the default
#PI_AUDIT_MODULE = 'privacyidea.lib.auditmodules.sqlaudit'
# This is used to sign the audit log
PI_AUDIT_KEY_PRIVATE = '/etc/privacyidea/private.pem'
PI_AUDIT_KEY_PUBLIC = '/etc/privacyidea/public.pem'
PI_LOGFILE = '/var/log/privacyidea/privacyidea.log'
PI_LOGLEVEL = logging.INFO

PI_PEPPER = .........................................................
SECRET_KEY = '.............................................'
SQLALCHEMY_DATABASE_URI = 'mysql://pi:............................@localhost/pi'





I ll give a try using ubuntu 14.4


Alexis Grammenos

unread,
Feb 14, 2017, 9:34:23 AM2/14/17
to privacyidea
Install UBUNTU 14.04
Installed PrivacyIdea {+ apache2, freeradius, etc} with pdf documentation

and then created resolver resolver followning: http://privacyidea.readthedocs.io/en/latest/userview/manage.html
#pi-manage resolver create_internal test
pi-manage realm create internal_realm test

After that I was able to create o user in the local database pi.<User_table>


Thanks for your time.
:)


--
Please read the blog post about getting help
https://www.privacyidea.org/getting-help/.
 
For professional services and consultancy regarding two factor authentication please visit
https://netknights.it/en/leistungen/one-time-services/
 
In an enterprise environment you should get a SERVICE LEVEL AGREEMENT which suites your needs for SECURITY, AVAILABILITY and LIABILITY:
https://netknights.it/en/leistungen/service-level-agreements/
---
You received this message because you are subscribed to a topic in the Google Groups "privacyidea" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/privacyidea/igBZxS6pyUo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to privacyidea+unsubscribe@googlegroups.com.

To post to this group, send email to priva...@googlegroups.com.
Visit this group at https://groups.google.com/group/privacyidea.

agram...@gmail.com

unread,
Feb 14, 2017, 9:36:14 AM2/14/17
to privacyidea
Finally Installed UBUNTU 14.04
Reply all
Reply to author
Forward
0 new messages