Netflix Authentication
The Netflix API uses OAuth security to guarantee application authentication with the API. Application API authorization is usually a process where you have to jump through multiple hoops, and this API is no exception. This API even has one more level of security for their users which is nice, though annoying as a developer since you have to deal with ANOTHER window opening up. Keep reading though and we’ll go through each part STEP BY STEP including an example with code. After this you should have no problem authenticating you applications.
To authenticate your application with Netflix you need to follow these steps.
1. Get a developer Consumer Key and Consumer Secret from Netflix, this requires you signing up with Netflix as a developer.
2. Use the Authentication Service, and call the requestToken(consumerKey:String, consumerSecret:String) method.
3. This method returns the Netflix OAuth Token in the result event (or an error in the fault event).
At this point you may start to wonder what you need to do with the results from the Netflix service. Well, we’ve taken care of that for you. In the service base class is a storage container for the results of these authentication services. You don’t need to adjust them, though you can if you want to – I wouldn’t recommend it. But the token and authorization and other information is held there for all future service calls, so you don’t have to worry about it placing them in future calls, you can just make your call. Ultimately we programmed this so you don’t have to worry about the little things. Though I would recommend storing this storage information for later so that you don’t have to do all this over and over again, for that I would use a LSO.
4. The next step is to get the Netflix Application Authorization. This gives your application access to the user’s information and the Access Token, the next thing you have to get before you can keep going. Now there is one problem, there is no result from this service, since this launches a Netflix Application Authorization window. Once you have your application authorized with Netflix you can keep going by that particular user, allowing you access to their queue information. Once you have the token, you can launch the Application Authorization by just calling:
1 | AuthenticationService.getAuthorization(); |
5. Now you have the Netflix Authorization and the token, you can get the Access Token. With the access token you can actually access the Netflix services. Again, by calling:
1 2 | var service:AccessTokenService = new AccessTokenService(); service.getAccessToken(); |
This method you get back a result/fault and the results are stored in the storage object. From this point you can start accessing any of the Netflix services that don’t deal with UserServices. Once you call the UserService.getUserInfo() you can get access to all the Netflix Services.
6. This final step is optional… ish. If you want to get all the Netflix services you just need to call:
1 2 | var service:UserService = new UserService(); service.getUserInfo(); |
This brings back the user’s information from Netflix and gives you access to ALL of the Netflix Services, including your current user’s queue.
Now, after 6 steps you are finally able to access all parts of the Netflix service. All of this is demonstrated here.





