Testing Your iTunes U Integration Code

Before you send an authorization token to iTunes U, you should test that your code constructs the token properly and that your results match what iTunes U expects.

For your testing purposes, Apple provides sample data you can use to test that your code produces the expected result. Using the sample data, your code should produce an identical authorization token to the one later in this section. If your code is not producing the same result, check for inconsistencies using the details provided earlier.

Using the following sample data:

The following should be your resulting token data.

credentials=Administrator%40urn%3Amace%3Aitunesu.com%3Asites%3Aexample.edu​&identity=%22Jane+Doe%22+%3Cjanedoe%40example.edu%3E+%28jdoe%29+%5B42%5D​&time=1147136717

And, after signing the token data with the shared secret, STRINGOFTHIRTYTWOLETTERSORDIGITS, your resulting signature value should be the following:

597c304e90fb62067c7e3fa57fe824e77997dd8aa96649366c5fc59104074744

Therefore, your authorization token should be:

credentials=Administrator%40urn%3Amace%3Aitunesu.com%3Asites%3Aexample.edu​&identity=%22Jane+Doe%22+%3Cjanedoe%40example.edu%3E+%28jdoe%29+%5B42%5D​&time=1147136717&signature=597c304e90fb62067c7e3fa57fe824e77997dd8aa96649366c5fc59104074744

Once you have your scripts working properly, you can test whether iTunes U understands the authentication data your system sends by transferring your site administrator credential to iTunes U as an authorization token.



© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-11-04)