MySQL user databases

36 views
Skip to first unread message

Andrei Burn

unread,
Oct 30, 2015, 8:54:44 AM10/30/15
to privacyidea
Hi all ... I'm trying to link my mysql user database with privacyidea, I've manage to connect with the mysql server which tells me that the users has been found,
but when I go to the users tab at my privacyidea, I cannot see the users or retrieve any info. 
also when I try to add a new users it creates a column on the server but the data I entered doesn't appear.
I am using only one table and I am mapping all the attributes which in this case are: id , username , surname , givenname , email.
I know it must be something silly that I am doing wrong, but I just cannot get around this.

Cornelius Kölbel

unread,
Oct 30, 2015, 9:19:40 AM10/30/15
to priva...@googlegroups.com
Hello Andrei,

the "test" button on the resolver configuration only counts the columns
in the specified table.

So probably something with your mapping is not right.

There are several steps to narrow down the problem.

0. Did you put the resolver into a realm?

1. look at the attribute mapping in your resolver. Can you please post
it?

2. take a look at the logfile privacyidea.log when looking at the users.
http://privacyidea.readthedocs.org/en/latest/installation/system/logging.html?highlight=debug

3. Take a look at the resolver definition in the database.
Table "resolverconfig"

Kind regards
Cornelius
> --
> You received this message because you are subscribed to the Google
> Groups "privacyidea" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to privacyidea...@googlegroups.com.
> To post to this group, send email to priva...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/privacyidea/7ac07144-63f6-4e1c-bb9b-911a5c7969bf%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

Andrei Burn

unread,
Nov 2, 2015, 6:11:05 AM11/2/15
to privacyidea
Hi Cornelius!

so this is my mapping  "id" : "id", "username": "username", "surname" : "surname", "givenname" : "givenname" , "email" : "email" }
another thing I've just notice now that when I try to install privacyidea on my other ubuntu machine I realised that pi-manage.py it's not working... when I tried to create a admin it returned the following errors

Traceback (most recent call last):

  File "/usr/bin/pi-manage.py", line 583, in <module>

    manager.run()

  File "/usr/lib/python2.7/dist-packages/flask_script/__init__.py", line 405, in run

    result = self.handle(sys.argv[0], sys.argv[1:])

  File "/usr/lib/python2.7/dist-packages/flask_script/__init__.py", line 384, in handle

    return handle(app, *positional_args, **kwargs)

  File "/usr/lib/python2.7/dist-packages/flask_script/commands.py", line 145, in handle

    return self.run(*args, **kwargs)

  File "/usr/bin/pi-manage.py", line 85, in add

    db.create_all()

  File "/usr/lib/python2.7/dist-packages/flask_sqlalchemy/__init__.py", line 895, in create_all

    self._execute_for_all_tables(app, bind, 'create_all')

  File "/usr/lib/python2.7/dist-packages/flask_sqlalchemy/__init__.py", line 887, in _execute_for_all_tables

    op(bind=self.get_engine(app, bind), **extra)

  File "/usr/lib/python2.7/dist-packages/sqlalchemy/schema.py", line 2848, in create_all

    tables=tables)

  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1478, in _run_visitor

    with self._optional_conn_ctx_manager(connection) as conn:

  File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__

    return self.gen.next()

  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1471, in _optional_conn_ctx_manager

    with self.contextual_connect() as conn:

  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1661, in contextual_connect

    self.pool.connect(),

  File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 272, in connect

    return _ConnectionFairy(self).checkout()

  File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 431, in __init__

    rec = self._connection_record = pool._do_get()

  File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 871, in _do_get

    return self._create_connection()

  File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 225, in _create_connection

    return _ConnectionRecord(self)

  File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 318, in __init__

    self.connection = self.__connect()

  File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 379, in __connect

    connection = self.__pool._creator()

  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/strategies.py", line 80, in connect

    return dialect.connect(*cargs, **cparams)

  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 283, in connect

    return self.dbapi.connect(*cargs, **cparams)

sqlalchemy.exc.OperationalError: (OperationalError) unable to open database file None None

Cornelius Kölbel

unread,
Nov 2, 2015, 6:42:25 AM11/2/15
to Andrei Burn, privacyidea
Hi Andrei,

The mapping needs to be 

"userid": Id column name

When running pi-manage you need to have read access to the files in /etc/privacyidea.
Just run the command as root. 

Kind regards Cornelius 



Cornelius Kölbel
+49 151 2960 1417

NetKnights GmbH
Landgraf-Karl-Str. 19, 34131 Kassel, Germany

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


-------- Ursprüngliche Nachricht --------
Von: Andrei Burn <andrei...@hotmail.com>
Datum: 02.11.2015 12:11 (GMT+01:00)
An: privacyidea <priva...@googlegroups.com>
Betreff: Re: MySQL user databases
--
You received this message because you are subscribed to the Google Groups "privacyidea" group.
To unsubscribe from this group and stop receiving emails from it, send an email to privacyidea...@googlegroups.com.
To post to this group, send email to priva...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages