i have ejabberd 16.03, i would like to query the database to get online users that are showed in admin panel.
Can someone help me? wich table i have to query?
I think i can do something like:
SELECT * FROM lasts WHERE
I need this to make a join with another table of external database. thanks for the help!
you can get online users from mnesia database or whatever database you configure such as redis etc if ejabberd configuration auth method is internal e.g.-
auth_method: internal //you can find it in ejabberd.yml
if ejabberd auth method is
odbc you can query from database (sm table where current session process id get stored if user id is exist in sm table means user is online) that you have configured. for more detail visit ejabberd authentication config docs
You can use
select * from sm
for odbc as backend
Related
I would like my login form to fetch if the user exists from another external database
example: from the site: test1.com/login
fetches if the user exists from the test2.com database.
I tried to set up the multiple connection but I did not find another solution to my problem
I'm trying to understand backends more and using row level security seems to be great idea to simplify backend code and increase security. I struggle to understand how to make RLS work. Let's say i have the following policy
CREATE POLICY user_mod_account ON accounts USING (username = current_user)
How does it know who is 'current_user'. I've followed few tutorials for making backend servers and if i'm not mistaken the way auth works is that you have some middleware that is in charge of authentication (usually by making additional requests against db to check if session exists and is valid), but all operations on the database are performed by backend which logs in as one user.
Let's say I have two tables - user, post and post has foreign key 'author' relating to 'username' in user table. Is it possible to have the following query on backend
SELECT * FROM post
and have it protected by RLS so the data is protected by the database itself (and have it return only posts from the user that backend is making request for)? If i connect to db as 'postgres' user, is 'current_user' postgres, or is there a way to make requests from backend as selected user. Maybe it's not the purpose of RLS, i would be glad if you could point me to some sources that could help me understand database <-> backend relation better. I feel like it is not really that complicated and my brain just didn't 'click' yet :P
How can I add a new user with password in DB2 and grand him access to the database, to select,insert,update data ?
I need to do this from command line.
Unlike many other DBMSs, DB2 does not store users inside the database. Authentication is done either at the OS level, or through the use of authentication plugins.
Can you please help me with some insight on using my own User repository/ database table for Identity server (IdentityServer3) to authenticate against?
I know other people have done it, but can’t seem to figure out how?
You need to write a user service. The docs and samples have very good coverage of that.
https://identityserver.github.io/Documentation/docs/advanced/userService.html
I have an application which connects to SQL Server 2000 (using a generic SQL Login and SQL Authentication). I would like to implement some logging via triggers to track data changes. I can't use USER_NAME() because that returns the generic account.
I've poked through master..sysprocesses and it doesn't seem to record the username (although it does record the machine name).
Any ideas how, within SQL, to gain access to the username?
(Note: yes, I could pass it in as a variable via the application ... but that would mean I'd have to roll out a new version of the app; I'm trying to do this from within SQL, so I can avoid that, if possible.)
You can't. Simple. SQL Server has no knowledge of the end user with a SQL login at all
The same applies if you use a proxy (web server etc) too: you don't know the end user. We use parameters/stored procs to pass in the username from the web server.
I would suggest that you set CONTEXT_INFO in the client which persists for that connection.
Have you tried SYSTEM_USER?
SELECT SYSTEM_USER