Exceptionless icon indicating copy to clipboard operation
Exceptionless copied to clipboard

Provisioning users

Open Edreih opened this issue 5 years ago • 5 comments
trafficstars

Hi again! Is there a way to quickly create many user accounts by leveraging the Exceptionless API? For example, is there a way for the user to avoid the sign up process, and just be able to log in?

I see an API function for inviting a user to an organization, but the user will still need to sign up. Additionally, if the invite token is not used during sign up, the user cannot see the orgs they've been invited to and there are two entries in the User tab. Snag_2766866

Edreih avatar Oct 16 '20 14:10 Edreih

That seems like a bug that it would be left over. I seen one other report for this but I thought it was a different scenario thanks for reporting this. As far as your question goes, you'd need to invite users via the api and they'd need to signup that way with a token.

Perhaps we could look up for all invites by a email address on signup without a token but that might be a security issue @ejsmith . If you are self hosting and are using Ldap I believe that allows users to sign right into an org but I've never tried it as I don't use ldap. How would you see bulk invites working?

niemyjski avatar Oct 16 '20 15:10 niemyjski

Thanks sir, bulk invites would work but with testing them manually, they do not seem to be working as expected:

I went ahead and re-tried the process but this time, I grabbed the invite token from Elasticsearch and tried to join the organization that way.

{
      "token": "Qouh61SNgPkW1lTSimSEOLdh5vi5B6cI0NFXLm8S",
      "email_address": "[email protected]",
      "date_added": "2020-10-19T19:08:52.5512899Z"
}

URL used to join organization: https://exceptionless.xxxx.com/account/verify?token=Qouh61SNgPkW1lTSimSEOLdh5vi5B6cI0NFXLm8S (I'm hoping this is the right URL?)

After signing up and logging in, I get a blue "Successfully verified your account" popup in the lower right. However, my user was not added into the organization

Edreih avatar Oct 19 '20 19:10 Edreih

Do you have html5 mode enabled for the ui? In your browser what did the request look like to the server to verify the token (what was the response and response status, also did the elastic document get updated and remove the invite)? It sounds like everything worked with that toast.

niemyjski avatar Oct 19 '20 23:10 niemyjski

Yes sir, HTML5 mode is enabled with this environment variable set: EX_HTML5MODE:TRUE

With my earlier attempts above, the response status would be 200 (Success) but the elastic document was not getting updated, and the project dropdown list would remain empty.

However, I realized the URL I was accessing was incorrect. I was accessing: https://exceptionless.xxxx.com/account/verify?token=XXXXXXXXX which is for verifying an email address. I should have been accessing: https://exceptionless.xxxx.com/signup?token=XXXXXXXXX

When signing up via the correct URL above the user gains access to the organization tied to that token and the Elastic document removes the token they used.

When signing up via the base URL (no token appended) the user gains access to Exceptionless, but their project dropdown list is empty even if they've received organization invites.

One issue I see with the above process is when a user receives multiple invites prior to creating an account. They will need to access each unique sign up URL and login in order to be added to each organization they were invited to. This could get tedious if there are many organizations

Edreih avatar Oct 20 '20 16:10 Edreih

@Edreih yeah, that is not ideal, but also seems like the user might want control over what invites they accept. This seems like an edge case so not too worried about it. I would accept a PR that makes it so that when a user signs up with a invite token that it also adds them to any other pending organization invites and removes them.

ejsmith avatar Oct 20 '20 23:10 ejsmith

I second this: I would accept a PR that makes it so that when a user signs up with a invite token that it also adds them to any other pending organization invites and removes them.

I'm going to close this in the meantime. But please feel free to open a pr and reference this issue.

niemyjski avatar Jul 26 '23 01:07 niemyjski