This response was very helpful. Here is what I have done, with specifics changed:
String appID = "myAppID";
String appKey = "myAppKey";
String host = "me.desire2learndemo.com";
D2LAppContext DAC = new D2LAppContext(appID, appKey, host);
URI authURL = DAC.createWebUrlForAuthentication( new URI("http:/myserver.com/d2l/authCallback.jsp"));
ID2LUserContext DUC = DAC.createUserContext(authURL);
URI coursesURL = DUC.createAuthenticatedUri( "/d2l/api/lp/1.3/courses/schema", "GET");
System.out.println("coursesURL " + coursesURL);
This all seems to be working well. The authURL contains x_a, x_b, and x_target values. The coursesURL contains x_a, x_b, x_c, x_d, and x_t.
When I call this URI, I get a 403 error.
When I paste this URI to my browser, I am redirected to login, which I am doing with admin credentials. The login passes, but I see the message:
"This application is not authorized on this LMS instance. Ask your administrator to authorize this application."
What should I do?
This response was very helpful. Here is what I have done, with specifics changed:
String appID = "myAppID";
String appKey = "myAppKey";
String host = "me.desire2learndemo.com";
D2LAppContext DAC = new D2LAppContext(appID, appKey, host);
URI authURL = DAC.createWebUrlForAuthentication( new URI("http:/myserver.com/d2l/authCallback.jsp"));
// user interaction required here
ID2LUserContext DUC = DAC.createUserContext(authURL);
URI coursesURL = DUC.createAuthenticatedUri( "/d2l/api/lp/1.3/courses/schema", "GET");
System.out.println("coursesURL " + coursesURL);
This all seems to be working well. The authURL contains x_a, x_b, and x_target values. The coursesURL contains x_a, x_b, x_c, x_d, and x_t.
When I call this URI, I get a 403 error.
When I paste this URI to my browser, I am redirected to login, which I am doing with admin credentials. The login passes, but I see the message:
"This application is not authorized on this LMS instance. Ask your administrator to authorize this application."
What should I do?