Page 1 of 1

SFS Admin account login

Posted: 25 Jul 2014, 13:01
by Madhusmita
Is there any API available to get the list of admin user accounts(from SFS Admin tool)?

Is it possible to check on SFS extension, whether the entered login credentials are matching with SFS Administrator tool admin accounts?

I tried the below mentioned code, but it only giving me the user details those are logged in(not for offline admin user)

Code: Select all

SmartFoxServer.getInstance().getUserManager().getUserByName("sfsadmin")
Server: SmartFoxServer_2X 2.9 version
Java Server extension - jdk 7

Re: SFS Admin account login

Posted: 02 Aug 2014, 08:01
by Lapo
( This was posted in the wrong section (SFS 1.x) )

You should check the user's permissions after the login.

Code: Select all

// Admin check
if (user.getPrivilegeId() == 3)
{
...
}
http://docs2x.smartfoxserver.com/Advanc ... ge-manager

Re: SFS Admin account login

Posted: 04 Aug 2014, 06:50
by Madhusmita
Actually my question is:
Suppose I am having admin account created on SFS admin tool with credential "admin1" and password "admin1".
1 - Then from my application if someone login with same credential, then Can I check whether the same credential has been already assigned to the SFS admin tool or not?
2 - If that credential match with admin credential, then Can I make that user login to the SFS Admin tool via application?

Is there any API available, which will give me the information whether the given credential is belong to the SFS admin tool or not?

Re: SFS Admin account login

Posted: 04 Aug 2014, 08:33
by Lapo
Madhusmita wrote: 1 - Then from my application if someone login with same credential, then Can I check whether the same credential has been already assigned to the SFS admin tool or not?
No. The AdminTool works with a private Zone, which is different from your application Zone.
What you can do is checking in your custom login class if a User logs in with those credentials and elevate his permissions to Admin.
2 - If that credential match with admin credential, then Can I make that user login to the SFS Admin tool via application?
This is not clear to me.
Users allowed to use the AdminTool are configured using the AdminTool itself, via the ServerConfigurator module. The data related to admins is then stored in the related configuration file.
Is there any API available, which will give me the information whether the given credential is belong to the SFS admin tool or not?
You can parse the config/server.xml file to access the Admin user name/pass dynamically.

Hope it helps