How and where to store user session information in a GTK application on Gnome environment? - session

I want to make a GTK application, plus sockets and DB. My system is Debian 11, Gnome environment. But before starting building it, I could not answer or find an answer to the question of user authentication with further access to the client part of the application.
For instance, login window appears, user wants to sign up and proceeds to fill the necessary entries. Then, when validation succeeds, main window pops up, but all the changes and activity in the app since then will pertain only to that specific user. And if a user wants to open the app again (I guess, there will be a session time limit, after which login window will appear again - but that is another question, let's forget it), everything will be restored and displayed as it was since the last time that user was logged in.
I only found, that all those user changes and information should be saved as a cache on client machine, with only little part in DB. Unfortunately, I am new to desktop application development on Gnome and desktop application development in general.
So, how to store that information/client app state, where and just how it works on Gnome specifically?

Related

Open a window on windows server in a user desktop from the SYSTEM level cmd

I came across an issue that I'm not entirely sure it is even possible.
I want to start a process (chrome browser for ex.) on a user desktop using a system level command prompt or powershell.
I tried many imitations such as runAs and -Credentials but they only open the process in the background "as" the user, not on the user's desktop. I want to actually RDP to the user's profile and see the browser open.
I'm aware there are risks of using system. This question is mostly on how to start a process on a specific user desktop rather than just appearing on task manager.
Edit to clarify the issue:
I'm using windows server which has several of users, all of them are users that i have their name and password.
On that server, i have a process running under SYSTEM which i need it to open a process with a UI (a browser for ex.) in one of the other users's desktop.
The user's session is open and runnign and i can RDP/VNC/SSH/whatever to it and open whatever i want but that is not what i need. I want to RDP to that user after the browser was opened and see that it is already opened.

How does Knock modify the lock screen?

The Knock app lets you knock on your iPhone to unlock your Mac.
I come from the iOS side and was naturally surprised to see it was able to modify the lock screen. How does it do that? Can any Mac OS X just do anything it wants to the lock screen?
(source: heavy.com)
Also, while installing, the password prompt seemed... unusual. It wasn't like the default password prompt, but more like the one on the lock screen:
(source: mshcdn.com)
Any idea about what's going on?
OSX has a security system that allows third party developers to develop authorisation plugins, in order to provide alternative or additional security, such as finger print scanners, iris readers or anything else you want to provide.
There's a database of rules which states for each type of security access, what security mechanisms are used. You can see this in action when you see the padlock icon in Security Preferences. Clicking on a locked icon brings up a security dialog asking for credentials.
The lock screen and login uses the same mechanism, so with this in mind, it's not too difficult to write a plugin which listens out for a network message (in this case, via bluetooth) from the iPhone, which is sent when the internal gyroscope picks up the knock.
Modifying the security rules database allows the developer to switch the standard login dialog for their security plugin and that's all there is to it.
As for being more secure, I'm not too sure about that; they are, after all, replacing the standard OSX security, which requires a password that is verified through Apple's cryptography.
If someone in your home picked up your iPhone, they can easily knock on it and unlock your Mac, but with a password, only you should know that!

Logon-type wxpython app

I manage a number of Windows PCs which are used to control equipment. Each computer has a specific program installed which is what people launch to use that equipment. We want to require people to log in before they can access this program.
Currently, I have a wxpython app which just launches that executable when people log in with the correct credentials. However, you can just run the program directly and bypass logging on. I'd like to make a mock logon screen, ie, fullscreen and modal, which only goes away when you log in. Also it should not be able to be bypassed by alt-tab, windows key, etc. How might I accomplish this with wxpython?
There is no full proof way to do this on Windows. You can show a wx.Frame modally using its MakeModal() method. And you can catch EVT_CLOSE and basically veto it it they try to close the frame. However, if they have access to the Task Manager or even Run, they can probably get around the screen. Most users won't be that smart though. You can delete the shortcuts to the apps you want to launch with wx and that will force most normal users to use your login screen. It's only the smart ones who like to troll through the file system who will go around it.

Password manager type application, is this tough stuff?

There is a password manager application for the MAC, and I was curious as to how one would go about developing such a fine piece of software.
I don't know much about the mac, just getting into xcode and iphone development actually.
The idea is, when you are at a website, and login it pops-up and asks if you want to save the login/password to the application.
You can also click on a previously saved login, and it will open up firefox and login for you.
How would you know when a browser is open, and when a form gets submitted?
What kind of application would this be i.e. project type in xcode?
I'd start by reading up on KeyChain, since that already does most of the work 1password is doing (i.e. securely storing passwords). As for bring up a prompt in web browsers etc, that's just a plugin for each browser it works with, so you'd have to dive into the plugin documentation for each web browser you wanted to support.
In short, it's not mind bogglingly difficult, but it's not a small task by any means. If you don't care about the browser integration you could probably write a thin wrapper around KeyChain quite easily, though I've never done it, so don't take my word as gospel.

Drag and drop on Win7 machine to my app

I have a user that is currently running my Winforms app on Win7. My app allows users to select rows from an open Excel spreadsheet and drag-n-drop them onto the app. However, this user cannot do the drag-n-drop. The cursor changes to the "no" cursor (little circle with line through it) and the operation won't complete.
I was researching drag-n-drop and Win7 and everything I found points to UAC and/or UIPI. I was looking for some solutions and am not sure if any of the below would work:
If the user logs in as admin (and as a result runs my app as admin) would that allow drag-n-drop to work?
Does the user need to turn off or change the settings of UAC/UIPI in order to be able to drag-n-drop?
I am not sure what the issue is. My app usually runs from C:/Documents and Settings/... (C:/Users/... on Win7). Does where it is running from matter? Does drag-n-drop not work because the user is not running my app with enough permissions? Are his Excel and my app on different permission levels? If so, what can be done about that? Note that even though my app allows users to just drag the file directly, that doesn't work either.
Also, is there any way I can have the user reproduce this issue with other apps? Are there apps that come with Win7 that he can see the same problem with. For example, can this be reproduced using Notepad?
Thanks.
Explaining this problem away by UIPI is a very long stretch. It doesn't have anything to do with whether or not the user is logged-in as an admin, that doesn't affect UAC and your program will be running with that same account anyway. The only way UIPI could kick in to stop a D+D is when your program is elevated and Excel is not.
To get yourself elevated requires work and doesn't happen by accident. You'd have to include a manifest so that the user gets the UAC prompt, you'd know about that. Or the user would have to change the desktop shortcut and tick the "Run this program as an administrator" option, she's know about that. While UIPI can be bypassed for Windows messages (ChangeWindowMessageFilter), it cannot for Drag and Drop so if any elevation is going on then your stuck. The ultimate test is to simply ask the user to put the UAC slider all the way down.
The much more likely scenario is that your DragEnter event handler simply isn't happy with the data it sees and therefore doesn't assign the e.Effect property. If you can't get a debugger on-site then write a little test program that logs the values of e.Data.GetFormats() plus whatever else you use to check if the drop is acceptable. And don't forget the obvious: the user simply fumbling the drag somehow.

Resources