Upload
bemyapp
View
185
Download
3
Tags:
Embed Size (px)
Citation preview
Orange APIs overview
Orange Partner MobileBankingFactory2 Challenge Renaud Cazoulat / March 24, 2015
Open Innovation with
Orange Partner
Orange Partner
Self Service APIs
Self service
Create Account
Register Your Application
Add APIs
Terms & Conditions
Browse Documentation
App Dashboard
Focus on
BeaconsManagement Platform
Beacon Application
Beacon Application
Beacon Application
Web Management
Statistics
IdentitySecure access
OAuth V2 OpenID Connect Mobile Connect
Identification Level
Get Authorization Code
curl -X GET \
"https://api.orange.com/oauth/v2/authorize?
scope=openid
&response_type=code
&client_id=6KRHymujFP8s0Zr6hGHj2k1Ee6a8SG2g
&prompt=none
&state=upToYouData
&redirect_uri=http%3A%2F%2Fwww.myserver.com"
Callback
http://www.myserver.com/?code=OFR-251f7...716a727f&state=upToYouData
Get Token
curl -X POST \
-H "Authorization: Basic NktSSHl...UdnlrT2lOaA==" \
-d "grant_type=authorization_code \
&code=OFR-251f7...716a727f \
&redirect_uri=http%3F%2F%2Fwww.myserver.com" \
https://api.orange.com/oauth/v2/token
"Basic "+base64encode(client_id+":"+client_secret")
Returned Token
{
”access_token" : "OFR-948ef...d5de1f4",
”expires_in" : 3600,
”id_token" : "eyJ0eX...8UtIl7mk",
”token_type" : Bearer
}
CloudAccess to user data
Features
Orange customer data access (read),
App private sub directory (read+write)
Folders listing, creation, deletion
File info, upload, download, deletion, thumbnail
Offline access
More to come in next release
Get Authorization Code
In a web browser:
"https://api.orange.com/oauth/v2/authorize?
scope=openid%20cloud
&response_type=code
&client_id=6KRHymujFP8s0Zr6hGHj2k1Ee6a8SG2g
&prompt=login%20consent
&state=upToYouData
&redirect_uri=http%3A%2F%2Fwww.myserver.com"
User Identification
Grant Access
Connect to Cloud
curl -X POST \ -H "Authorization: Bearer OFR-948ef...d5de1f4" \https://api.orange.com/cloud/v1/session
Connect to Cloud
curl -X POST \ -H "Authorization: Bearer OFR-948ef...d5de1f4" \https://api.orange.com/cloud/v1/session
{ "esid": "xoQCw2...4Fw==" }
List Root Folder
curl -X GET \ -H "X-Orange-CA-ESID: xoQCw2...4Fw==" \ -H "Authorization: Bearer OFR-948ef...d5de1f4" \ https://api.orange.com/cloud/v1/folders/
List Root Folder
curl -X GET \ -H "X-Orange-CA-ESID: xoQCw2...4Fw==" \ -H "Authorization: Bearer OFR-948ef...d5de1f4" \ https://api.orange.com/cloud/v1/folders/
{ "id": "VHlwZSAob3IgcGFzdGUpIGhlcmUuLi4=", "parentId": "Lw==", "name": "MyBeautifulApp", "files": [{ "id": "dmlkZW9EZWZhdWx0Lm1wNA==", "name": "videoDefault.mp4", "type": "VIDEO" }, { "id": "cGRmRGVmYXV0LnBkZg==", "name": "pdfDefaut.pdf", "type": "FILE" }
]}}
Cloud SDKs• OpenID Connect + Cloud
• SDK + sample app
• iOS, Android & Python
• available on github : OrangeCloudAndroidSdk OrangeCloudIOSSdk
iOS Cloud SDK
// in main controller
- (void)viewDidLoad { [super viewDidLoad]; // Create the object that will make both user authentication // and cloud session management self.cloudSession = [[CloudSession alloc] initWithAppKey:@"yourClientId" appSecret:@"yourClientSecret" redirectURI:@"yourURIredirect"]; }
// in app delegate
- (void)applicationDidBecomeActive:(UIApplication *)application { [self.mainController connect]; }
iOS Cloud SDK
// in main controller, how to connect:
- (void) connect { [self.cloudSession openSessionFrom:self success:^{ [self.cloudSession rootFolderWithSuccess:^(CloudItem * cloudItem) { [self setViewControllers:@[[[FileListViewController alloc]
initWithSession:self.cloudSession item:cloudItem]]];
} failure:^(CloudStatus status) { NSLog (@"Error while getting root folder"); }]; } failure:^(CloudStatus status) { NSLog (@"Error while connecting user"); }]; }
Next steps
WebinarStart
March 24 April 14
Webinar Coaching
Ad-hocMarch 14
Jury
May 19