Skip to content
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

E2E: do not modifiy userid #2186

Merged
merged 1 commit into from
Mar 13, 2018
Merged

E2E: do not modifiy userid #2186

merged 1 commit into from
Mar 13, 2018

Conversation

tobiasKaminsky
Copy link
Member

@tobiasKaminsky tobiasKaminsky commented Feb 16, 2018

Fix #2173
Fix #2134

As we now have a call to get the uid, we shall not split the string, as usernames such as are valid: tobi@nc

Signed-off-by: tobiasKaminsky tobias@kaminsky.me

@AndyScherzinger
Copy link
Member

but wouldn't you now be using tobi@nc@yourawesomeserver.com?

@tobiasKaminsky
Copy link
Member Author

No, we fetch the userid, which never has server included, e.g:
userid: tobi@nc
name: tobias kaminsky
email: tobias@nc.server.com

Now with userid fetching, it does not matter with what you authenticate (userid, name, email), the CSR will always use userid (tobi@nc).

Previously, we took simply the "id" with which we authenticated (on account setup).
So if you back then used "tobi@nc" it was fine, as loginid matches the userid.
But if you used your email address, it would not have worked.

@AndyScherzinger
Copy link
Member

AndyScherzinger commented Feb 16, 2018

👍 alright! I did think the userId is actually username@server which is why we usually do the @-split.

Approved with PullApprove

@mario
Copy link
Contributor

mario commented Feb 20, 2018

Sure, but how do we migrate existing users?

@tobiasKaminsky
Copy link
Member Author

We do not have to: CSR is only signed by server if common name in CSR matches the userid.
Therefore we get always the userid before generating a CSR:

// get user id
String userID;
GetRemoteUserInfoOperation remoteUserNameOperation = new GetRemoteUserInfoOperation();
RemoteOperationResult remoteUserNameOperationResult = remoteUserNameOperation
.execute(account, getContext(), true);
if (remoteUserNameOperationResult.isSuccess() &&
remoteUserNameOperationResult.getData() != null) {
UserInfo userInfo = (UserInfo) remoteUserNameOperationResult.getData().get(0);
userID = userInfo.getId();
} else {
userID = account.name;
}
// create CSR
String urlEncoded = CsrHelper.generateCsrPemEncodedString(keyPair, userID);

(the above is true for all stable app releases, on alpha testing there was no server side checking of userid)

@mario
Copy link
Contributor

mario commented Mar 13, 2018

👍

Approved with PullApprove

…as usernames as such are valid: tobi@nc

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants