If you don't find an answer, please click here to post your question.
Reply
Occasional Visitor
Posts: 1
Registered: ‎07-24-2017

iOS OOSecureURLGenerator implementation

It is recommended that the API secret be kept server-side.  How am I supposed to make a call to the server to generate a secure URL using the api key and secret, when the OOSecureURLGenerator protocol has a secureURL method that returns immediately without an asychronous callback:

 

#import <Foundation/Foundation.h>

 

/**

 * @brief A protocol used to request a signed URL for Player API requests

 */

@protocol OOSecureURLGenerator <NSObject>

 

/**

 * Generate the secure URL

 * @par

 * This method should use one of the following security method to create a complete NSURL:

 * @li Create a signature from the parameters (including API Key and Domain, which are not guaranteed to be in params) and a secret

 * @param[in] host the hostname for the URL

 * @param[in] uri the URI for the URL

 * @param[in] params the URI params for the URL (not including any security params that the security method would use)

 * @returns a secure NSURL created from the parameters using one of the supported security methods

 */

- (NSURL *)secureURL:(NSString *)host uri:(NSString *)uri params:(NSDictionary *)params;

 

@end

 

Ooyalan
Posts: 20
Registered: ‎01-03-2017

Re: iOS OOSecureURLGenerator implementation

Hello adarr,

 

You will need to create a different environment to manage those calls. You need to build something like a middleware where you will make those calls to it instead of leaving that method in the app.

 

In our sample apps we leave the method in the app just an example but it is not the best practice.

 

 

Regards.

Ooyala TS

Occasional Advisor
Posts: 5
Registered: ‎08-19-2017

Re: iOS OOSecureURLGenerator implementation

Sorry, I use android