Note that there are some explanatory texts on larger screens.

plurals
  1. PODesire 2 Learn Valence API authentication and cookies
    primarykey
    data
    text
    <p>I'm trying to use the valence api in a headless manner. </p> <p>Side note: I had to modify the hyperlinks so they were not links or I couldn't post the question.</p> <p>Scenario 1:</p> <p>When using the Java example provided, the following URLs are hit if no cookies are present:</p> <p><a href="https://elearning.masked.edu/d2l/auth/api/token?x_a=JjGDh8MaskedDgOGlPPagA&amp;x_b=gnNIMasked99PGLtcVflc_488PD59k2TjJbfyj-jlXHY&amp;x_target=http%3A%2F%2Flocalhost%3A8080%2FD2LValenceExample%2Findex.jsp" rel="nofollow noreferrer">https://elearning.masked.edu/d2l/auth/api/token?x_a=JjGDh8MaskedDgOGlPPagA&amp;x_b=gnNIMasked99PGLtcVflc_488PD59k2TjJbfyj-jlXHY&amp;x_target=http%3A%2F%2Flocalhost%3A8080%2FD2LValenceExample%2Findex.jsp</a></p> <p>Which gives me a 302 response and sends the browser to</p> <p><a href="https://elearning.masked.edu/d2l/login?target=%2fd2l%2fauth%2fapi%2ftoken%3fx_a%3dJjGDh8MaskedDgOGlPPagA%26x_b%3dgnNIMasked99PGLtcVflc_488PD59k2TjJbfyj-jlXHY%26x_target%3dhttp%253a%252f%252flocalhost%253a8080%252fD2LValenceExample%252findex.jsp&amp;sessionExpired=1" rel="nofollow noreferrer">https://elearning.masked.edu/d2l/login?target=%2fd2l%2fauth%2fapi%2ftoken%3fx_a%3dJjGDh8MaskedDgOGlPPagA%26x_b%3dgnNIMasked99PGLtcVflc_488PD59k2TjJbfyj-jlXHY%26x_target%3dhttp%253a%252f%252flocalhost%253a8080%252fD2LValenceExample%252findex.jsp&amp;sessionExpired=1</a></p> <p>Which gives me another 302 response and sends the browser to</p> <p><a href="https://elearning.masked.edu/?target=%2fd2l%2fauth%2fapi%2ftoken%3fx_a%3dJjGDh8MaskedDgOGlPPagA%26x_b%3dgnNIMasked99PGLtcVflc_488PD59k2TjJbfyj-jlXHY%26x_target%3dhttp%253a%252f%252flocalhost%253a8080%252fD2LValenceExample%252findex.jsp" rel="nofollow noreferrer">https://elearning.masked.edu/?target=%2fd2l%2fauth%2fapi%2ftoken%3fx_a%3dJjGDh8MaskedDgOGlPPagA%26x_b%3dgnNIMasked99PGLtcVflc_488PD59k2TjJbfyj-jlXHY%26x_target%3dhttp%253a%252f%252flocalhost%253a8080%252fD2LValenceExample%252findex.jsp</a></p> <p>Which is the D2L login screen. So I log in and a post with my credentials is sent to:</p> <p><a href="https://elearning.masked.edu/d2l/lp/auth/login/login.d2l" rel="nofollow noreferrer">https://elearning.masked.edu/d2l/lp/auth/login/login.d2l</a></p> <p>Finally, my browser is sent to the D2L home:</p> <p><a href="https://elearning.masked.edu/d2l/lp/homepage/home.d2l?ou=1234123" rel="nofollow noreferrer">https://elearning.masked.edu/d2l/lp/homepage/home.d2l?ou=1234123</a> </p> <p>This doesn't follow the flow as listed in <a href="http://docs.valence.desire2learn.com/basic/auth.html" rel="nofollow noreferrer">http://docs.valence.desire2learn.com/basic/auth.html</a> . I was expecting a redirect to the appURL.</p> <p>But, when we do this a second time, the expected result is achieved:</p> <p>Scenario 2:</p> <p><a href="https://elearning.masked.edu/d2l/auth/api/token?x_a=JjGDh8MaskedDgOGlPPagA&amp;x_b=gnNIMasked99PGLtcVflc_488PD59k2TjJbfyj-jlXHY&amp;x_target=http%3A%2F%2Flocalhost%3A8080%2FD2LValenceExample%2Findex.jsp" rel="nofollow noreferrer">https://elearning.masked.edu/d2l/auth/api/token?x_a=JjGDh8MaskedDgOGlPPagA&amp;x_b=gnNIMasked99PGLtcVflc_488PD59k2TjJbfyj-jlXHY&amp;x_target=http%3A%2F%2Flocalhost%3A8080%2FD2LValenceExample%2Findex.jsp</a></p> <p><a href="http://localhost:8080/D2LValenceExample/index.jsp?x_a=Da6kyMaskedDMZy8l_1&amp;x_b=SV6_ONhvMaskedoBc_hHZ&amp;x_c=oD7JMT9CGgyLljIF_1MaskedCI5YZHJPcIgKD4" rel="nofollow noreferrer">http://localhost:8080/D2LValenceExample/index.jsp?x_a=Da6kyMaskedDMZy8l_1&amp;x_b=SV6_ONhvMaskedoBc_hHZ&amp;x_c=oD7JMT9CGgyLljIF_1MaskedCI5YZHJPcIgKD4</a></p> <p>The difference is the cookies. When I delete the cookies for elearning.masked.edu, the result in scenario 1 always happens. So the question becomes what is the correct way to make the web-service authentication call when we are starting without cookies?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload