Modifying an iTunes U Script

While working out all the details of how to integrate iTunes U with your authentication and authorization services, you can use the iTunes U Help & Resources site example code (iTunes U Sample Code (ZIP)) located at http://www.apple.com/support/itunes_u/ to help you develop your transfer script.

To do this, use the information you received when you activated your site and modify one of the example scripts from the iTunes U Help & Resources site. By modifying an example script as described later in this section, you receive administrator access to your site. To integrate iTunes U with your authentication and authorization services and provide specific access to other users, you need to make further modifications.

To modify the Java sample script (ITunesU.java):

  1. Edit the following variables located in the main() method of the Java class so the values match the values displayed in your Edit Site Setting page:

    • String siteURL

    • String debugSuffix

    • String sharedSecret

    • String administratorCredential

  2. Save the file.

  3. Compile the ITunesU.java file: javac ITunesU.java.

  4. Copy the ITunesU.class file and the itunesu shell script to your web server’s cgi-bin directory.

  5. Call the script from your web browser: http://example.com/cgi-bin/iTunesU.

iTunes U displays your institution’s root page. You can begin editing your iTunes U site pages.

You can also change the user identification information by editing the following variables located in the main() method of the ITunesU.java file: String displayName, String emailAddress, String username, and String userIdentifier. If you do this, you must repeat steps 2 through 5 for the changes to take effect.

Important: At this stage, anyone who can access the URL in step 5 can administer your iTunes U site. To make sure your site is secure, limit access to your site by limiting access to the updated Java sample script.

If your integration is not working properly, or you do not have access to the iTunes U site you are trying to log in to, iTunes U redirects you to a default webpage. To help you determine why your integration failed, append the Debug Suffix displayed in the Edit Site Settings page (available only to the primary administrator) to the end of your site URL. iTunes U displays an Access Debugging page containing information about the transfer identity and credentials received, the validity of the signature received, and the access provided to the specified URL destination. For more information, see “Debugging Site Access and Integration.”

Note: Transfer Script Information in the Edit Site Settings page is only available to the primary administrator.



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