Uploaded image for project: 'IGB'
  1. IGB
  2. IGBF-2576

Initialize DE user workspace on login

    Details

    • Type: Task
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Story Points:
      3
    • Sprint:
      Fall 5 Nov 9 - Nov 20, Fall 6 Nov 30 - Dec 11, Fall 7 Dec 14 - Dec 23, Winter 1 Dec 28 - Jan 8, Winter 2 Jan 11 - Jan 22, Winter 3 Jan 25 - Feb 5, Winter 4 Feb 8 - Feb 19, Winter 5 Feb 22 - Mar 5, Winter 6 Mar 8 - Mar 19

      Description

      Situation: There is an edge case where if a user creates a CyVerse account and tries to log in to BioViz Connect without ever signing into the CyVerse Discovery Environment, BioViz Connect is unable to run analyses. This is due to the user's workspace not being set up, which occurs the first time the user logs in to the CyVerse Discovery Environment.

      Task: Add a call to initialize the user's workspace when they login to BioViz Connect. According to the documentation, we may need to also hit the logout endpoint (if we are not already).

      Initializing workspace
      Swagger docs

        Attachments

          Issue Links

            Activity

            Hide
            cdias1 Chester Dias (Inactive) added a comment -

            Nowlan Freese
            I tried the below scenario with a fork from your repository
            1. Create a new account on cyverse https://user.cyverse.org/ upto steps for account verification and setting up password
            2. I logged out of the default nowlanf account on http://testingsite.bioviz.org/
            3. Tried to login with the new account from 1. It did not throw any error as such.
            Attached a screenshot for new account page view after login into bioviz connect
            Is there something I missed?

            Show
            cdias1 Chester Dias (Inactive) added a comment - Nowlan Freese I tried the below scenario with a fork from your repository 1. Create a new account on cyverse https://user.cyverse.org/ upto steps for account verification and setting up password 2. I logged out of the default nowlanf account on http://testingsite.bioviz.org/ 3. Tried to login with the new account from 1. It did not throw any error as such. Attached a screenshot for new account page view after login into bioviz connect Is there something I missed?
            Hide
            nfreese Nowlan Freese added a comment -

            Tested:
            Created new account at https://user.cyverse.org/signup
            Verified email.
            Waited until I received emails stating that Discovery Environment access was granted.
            Went to https://www.bioviz.org/connect.html and logged in with new CyVerse credentials.
            BioViz Connect loaded the home folder.
            Uploaded the two attached files (test.bam and test.bam.bai).
            Right-clicked on test.bam and selected analyse > Make coverage graph
            Analysis Name: Test1
            Output File Name : Test1.bedgraph
            Clicked Run Analysis

            I was then logged out of BioViz Connect
            I then used the initialize user workspace endpoint (https://de.cyverse.org/terrain/secured/bootstrap)
            When I logged back in to BioViz Connect, I was now able to run the analysis

            So we do need to hit the initialize user workspace endpoint. For some reason the user is unable to run analyses until that endpoint is hit. If the user logs into CyVerse Discovery Environment, the initialize user workspace endpoint is hit, which is why we hadn't run into this issue prior.

            Show
            nfreese Nowlan Freese added a comment - Tested: Created new account at https://user.cyverse.org/signup Verified email. Waited until I received emails stating that Discovery Environment access was granted. Went to https://www.bioviz.org/connect.html and logged in with new CyVerse credentials. BioViz Connect loaded the home folder. Uploaded the two attached files (test.bam and test.bam.bai). Right-clicked on test.bam and selected analyse > Make coverage graph Analysis Name: Test1 Output File Name : Test1.bedgraph Clicked Run Analysis I was then logged out of BioViz Connect I then used the initialize user workspace endpoint ( https://de.cyverse.org/terrain/secured/bootstrap ) When I logged back in to BioViz Connect, I was now able to run the analysis So we do need to hit the initialize user workspace endpoint. For some reason the user is unable to run analyses until that endpoint is hit. If the user logs into CyVerse Discovery Environment, the initialize user workspace endpoint is hit, which is why we hadn't run into this issue prior.
            Hide
            nfreese Nowlan Freese added a comment -

            I have updated the description with the new information.

            Show
            nfreese Nowlan Freese added a comment - I have updated the description with the new information.
            Hide
            ann.loraine Ann Loraine added a comment -

            Chester Dias - could you take a look at this one next?

            Show
            ann.loraine Ann Loraine added a comment - Chester Dias - could you take a look at this one next?
            Hide
            cdias1 Chester Dias (Inactive) added a comment -

            sure. Will pick this up next.

            Show
            cdias1 Chester Dias (Inactive) added a comment - sure. Will pick this up next.
            Hide
            cdias1 Chester Dias (Inactive) added a comment - - edited

            Based on the discussion today and after some more trial and error, i decided that the right place to add the user initialisation is after cookies are validated in the cyverse.js file.
            I have created the functions but the endpoint does not seem to function as expected
            curl -X GET -H "Accept: application/json" -H "Authorization: BEARER <ACCESSTOKEN>" "https://de.cyverse.org/terrain/secured/bootstrap?ip-address=173.95.25.211"

            RESPONSE from server was
            {"error_code":"ERR_SCHEMA_VALIDATION","reason":{"user_info":

            {"email":"(not (instance? java.lang.String \\d))","first_name":"(not (instance? java.lang.String \\C))","last_name":"(not (instance? java.lang.String \\D))"}

            }}

            I am not sure for the cause of this error. Command is based on the swager link
            https://de.cyverse.org/terrain/docs/index.html#!/bootstrap/get_terrain_secured_bootstrap

            Nowlan Freese or Karthik Raveendran Could either of you please check the command once? It does not seem to suggest unauthorized error.

            I tried with my IP and the server IP

            Show
            cdias1 Chester Dias (Inactive) added a comment - - edited Based on the discussion today and after some more trial and error, i decided that the right place to add the user initialisation is after cookies are validated in the cyverse.js file. I have created the functions but the endpoint does not seem to function as expected curl -X GET -H "Accept: application/json" -H "Authorization: BEARER <ACCESSTOKEN>" "https://de.cyverse.org/terrain/secured/bootstrap?ip-address=173.95.25.211" RESPONSE from server was {"error_code":"ERR_SCHEMA_VALIDATION","reason":{"user_info": {"email":"(not (instance? java.lang.String \\d))","first_name":"(not (instance? java.lang.String \\C))","last_name":"(not (instance? java.lang.String \\D))"} }} I am not sure for the cause of this error. Command is based on the swager link https://de.cyverse.org/terrain/docs/index.html#!/bootstrap/get_terrain_secured_bootstrap Nowlan Freese or Karthik Raveendran Could either of you please check the command once? It does not seem to suggest unauthorized error. I tried with my IP and the server IP
            Hide
            nfreese Nowlan Freese added a comment -

            Chester Dias - I tested the following on the command line on my Mac:

            curl -X GET -H "Accept: application/json" -H "Authorization: BEARER ACCESSTOKEN" "https://de.cyverse.org/terrain/secured/bootstrap?ip-address=173.95.25.211"

            curl -L -X GET 'https://de.cyverse.org/terrain/secured/bootstrap' -H 'Authorization: Bearer ACCESSTOKEN'

            curl -X GET -H "Accept: application/json" -H "Authorization: BEARER ACCESSTOKEN" "https://de.cyverse.org/terrain/secured/bootstrap?ip-address=0.0.0.0"

            All of these worked for me. I'm not sure what the error you received is saying, it seems very odd. Let's test this together on Wednesday.

            Show
            nfreese Nowlan Freese added a comment - Chester Dias - I tested the following on the command line on my Mac: curl -X GET -H "Accept: application/json" -H "Authorization: BEARER ACCESSTOKEN" "https://de.cyverse.org/terrain/secured/bootstrap?ip-address=173.95.25.211" curl -L -X GET 'https://de.cyverse.org/terrain/secured/bootstrap' -H 'Authorization: Bearer ACCESSTOKEN' curl -X GET -H "Accept: application/json" -H "Authorization: BEARER ACCESSTOKEN" "https://de.cyverse.org/terrain/secured/bootstrap?ip-address=0.0.0.0" All of these worked for me. I'm not sure what the error you received is saying, it seems very odd. Let's test this together on Wednesday.
            Hide
            cdias1 Chester Dias (Inactive) added a comment -

            As discussed during the meeting with Nowlan Freese after trying to replicate the issue, It turns out that the token returned during initial login on biovizconnect is not able to retrieve the data from the endpoint https://de.cyverse.org/terrain/secured/bootstrap

            but using the token returned from the https://de.cyverse.org/terrain/token does work.

            Nowlan Freese Please let me know the response to the mail to the cyverse team on this issue. I will go ahead and add all the code so far to the codebase so all we have to do later would be only to modify some URLs as discussed.

            Show
            cdias1 Chester Dias (Inactive) added a comment - As discussed during the meeting with Nowlan Freese after trying to replicate the issue, It turns out that the token returned during initial login on biovizconnect is not able to retrieve the data from the endpoint https://de.cyverse.org/terrain/secured/bootstrap but using the token returned from the https://de.cyverse.org/terrain/token does work. Nowlan Freese Please let me know the response to the mail to the cyverse team on this issue. I will go ahead and add all the code so far to the codebase so all we have to do later would be only to modify some URLs as discussed.
            Hide
            nfreese Nowlan Freese added a comment - - edited

            Update from CyVerse:

            "This is a strange problem. When the authentication happens via the authorization_code flow, CAS returns the user attributes as arrays of strings even when there’s only one value. When the authentication happens via the password flow, CAS returns single-valued user attributes as strings.

            Unfortunately, I haven’t been able to find a way to get the attributes to be returned in the same way for the two different flows, which means that a change to Terrain is going to be required. I’ll make the code change and let you know when it’s ready to go."

            Show
            nfreese Nowlan Freese added a comment - - edited Update from CyVerse: "This is a strange problem. When the authentication happens via the authorization_code flow, CAS returns the user attributes as arrays of strings even when there’s only one value. When the authentication happens via the password flow, CAS returns single-valued user attributes as strings. Unfortunately, I haven’t been able to find a way to get the attributes to be returned in the same way for the two different flows, which means that a change to Terrain is going to be required. I’ll make the code change and let you know when it’s ready to go."
            Hide
            nfreese Nowlan Freese added a comment -

            The issue has been fixed. The token returned from https://de.cyverse.org/terrain/secured/bootstrap should now work when hitting the /secured/bootstrap Terrain endpoint.

            Chester Dias - please move ahead with this issue when you have time.

            Show
            nfreese Nowlan Freese added a comment - The issue has been fixed. The token returned from https://de.cyverse.org/terrain/secured/bootstrap should now work when hitting the /secured/bootstrap Terrain endpoint. Chester Dias - please move ahead with this issue when you have time.
            Show
            cdias1 Chester Dias (Inactive) added a comment - Please review: https://bitbucket.org/chesterdias/django-cyversedev/branch/IGBF-2576#diff
            Hide
            nfreese Nowlan Freese added a comment -

            Code looks good, please submit a pull request.

            Show
            nfreese Nowlan Freese added a comment - Code looks good, please submit a pull request.
            Show
            cdias1 Chester Dias (Inactive) added a comment - PR: https://bitbucket.org/nfreese/bioviz-connect/pull-requests/243/igbf-2576
            Show
            nfreese Nowlan Freese added a comment - Merged https://bitbucket.org/nfreese/bioviz-connect/pull-requests/243/igbf-2576
            Hide
            ann.loraine Ann Loraine added a comment - - edited

            Code is deployed on https://bvctest6.bioviz.org.
            Karthik Raveendran - please check that the DE initialization workflow is functioning properly. Please test with someone on the team who lacks a CyVerse account. Walk them through the process step-by-step and make note of any problems that are observed.

            Show
            ann.loraine Ann Loraine added a comment - - edited Code is deployed on https://bvctest6.bioviz.org . Karthik Raveendran - please check that the DE initialization workflow is functioning properly. Please test with someone on the team who lacks a CyVerse account. Walk them through the process step-by-step and make note of any problems that are observed.
            Hide
            karthik Karthik Raveendran added a comment - - edited

            The DE initialization workflow was tested with two candidates. One candidate registered to Cyverse, verified the account (where you can add a password) and then signed in the Cyverse account. Candidate 2 registered to Cyverse, verified the account but did not sign in the Cyverse account. Both candidate was able to log in to Bioviz Connect without a hitch.

            Show
            karthik Karthik Raveendran added a comment - - edited The DE initialization workflow was tested with two candidates. One candidate registered to Cyverse, verified the account (where you can add a password) and then signed in the Cyverse account. Candidate 2 registered to Cyverse, verified the account but did not sign in the Cyverse account. Both candidate was able to log in to Bioviz Connect without a hitch.
            Hide
            karthik Karthik Raveendran added a comment -

            I also noticed that https://bvctest6.bioviz.org did not have "View in IGB" buttons for compatible file types.

            Show
            karthik Karthik Raveendran added a comment - I also noticed that https://bvctest6.bioviz.org did not have "View in IGB" buttons for compatible file types.
            Hide
            nfreese Nowlan Freese added a comment -

            Karthik Raveendran - did you test that the user that had not signed in to the CyVerse Discovery Environment was able to run analyses?

            Show
            nfreese Nowlan Freese added a comment - Karthik Raveendran - did you test that the user that had not signed in to the CyVerse Discovery Environment was able to run analyses?
            Hide
            ann.loraine Ann Loraine added a comment - - edited

            Unfortunately, I was not able to get the playbooks to run properly and provision the MySQL database. I tried using the "migrate" option and also the previous method, but neither has worked. Please see: IGBF-2818 (linked issue).
            However, it may be possible to assess whether changes to enable DE user workspace creation on first login (this issue) independently from analysis-related functions.

            Show
            ann.loraine Ann Loraine added a comment - - edited Unfortunately, I was not able to get the playbooks to run properly and provision the MySQL database. I tried using the "migrate" option and also the previous method, but neither has worked. Please see: IGBF-2818 (linked issue). However, it may be possible to assess whether changes to enable DE user workspace creation on first login (this issue) independently from analysis-related functions.

              People

              • Assignee:
                cdias1 Chester Dias (Inactive)
                Reporter:
                nfreese Nowlan Freese
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: