-
Notifications
You must be signed in to change notification settings - Fork 1
Feature: Generate User Tokens #389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev-dhi
Are you sure you want to change the base?
Conversation
@jdanish Please give this a spin to see if this works for managing user tokens. There are multiple things to try:
Most likely you won't have Test 1: Check if
|
Issue: the tokens I generated work, but the shared ones don't even work in the initial graph ... thoughts? (treat as incorrect password) ![]() Edit: updated screen cap @benloh wanted to make sure you didn't miss this one. |
I need to run past Kalani, but I think this approach works. We will want to change the word "salt" maybe to make it more intuitive and maybe put "Admin password: " before the box to avoid confusion? Also, is the password checked on the server or client? That is, could I figure out the password easily using the javascript console? It's not terribly likely, but ... Otherwise, yes I like this approach so far. Note, I've only tested locally so far ... DO soon. |
Hmm...maybe we do need to drop the notion of shareable tokens after all. I think the degree of shareability is affected by the presence or absence of the
i think the important thing at this stage is making sure the admin password approach makes sense. I was deliberately trying to make it vague so that there isn't a giant "Admin Password" field that simply invites hacking. But if that's what you prefer we can do that. Keep in mind that a student going to the Advanced panel will immediately see the "Admin password" field. The password is definitely not super secure. But you shouldn't be able to see in in plain javascript. If we inadvertently left the project template definition visible then yes it is visible (e.g. if we had a console command like I was trying to avoid the |
OK, let's go with secretKey, and use this for now and assume long-term we
need full authentication, but this is pretty safe. I'm OK with kids seeing
Admin password since they won't have a way to figure out what it is, and
honestly none are trying so far. One will eventually, but then it's up to
the teacher to hide the sticky-note.
|
Use the "Advanced Panel" to generate User Tokens.
Wiki
Advanced Panel
How protections work
To make it security protections less obvious (and more difficult for students to suss out) there are three levels of password protection.
CAVEAT: This is low grade security at best and is relatively easy to work around.
1. Student / Regular User View
By default, the "Advanced" panel is visible, but only the "Export" tab is visible.
At the bottom of the "Advanced" panel is an unlabeled password input field with no "Submit" button.
adminPassword
has not been defined however, a❄︎
will be displayed.2. Privileged Import User
For some projects, e.g. research groups, sometimes you need to allow a logged in user to be able to import node/edge data. There is a template setting that allows this:
If this is set and a user is logged in, the "Import Data" panel will be visible.
3. Teacher
With a password, a teacher can access teacher-enabled advanced panel tabs:
In order to access those items, a teacher must enter a password.
adminPassword
field.adminPassword
has not been defined however, a❄︎
will be displayed.4. Researcher: Look Up Password
If a teacher forgets the password, or a researcher needs to access the "Advanced" panel, what can they do?
We are disabling the
?admin=true
override, so you will have to look up the password via the template.Digital Ocean
On Digital Ocean, the fix is to look up the current template via ssh.
NC_CONFIG
to determine thedataset
name.Turbo360
On Turbo360, the fix is to look up the current template in Turbo360's portal.
https://portal.turbo360.co/
and log in<dataset>.template.toml
file to download itadminPassword
field.User Tokens
Historically, user tokens were defined either by using the web console
ncMakeTokens
command or to usenc-multiplex's
UI tool.The new "Advanced" panel can now be used to generate tokens.
salt
By default, tokens are project-template-specific. The project has a
salt
string that is used to create a unique hash for the user token.salt
can be any string less than 12 characters.salt
for each classroom's project.salt
is not defined in the template, tokens can still be generated, but the tokens can then be used on any other project that does not havesalt
defined. (Under the hood, the hash uses just theclassId
and theprojId
as the salt, skipping the project salt).salt
is not defined, the "Shareable" tokens checkbox will be automatically checked and disabled, and a warning message displayed.