eso-library-for-cordova
v1.0.0
Published
### Assumes working knowledge of Cordova and Git
Downloads
1
Maintainers
Readme
ESO Plugin Integration guide
Assumes working knowledge of Cordova and Git
Requirements
- The existing project must be target Android API 18+ and iOS8+
- Must be using Cordova Android 4.0.2 or higher
- Must be using Cordova iOS 3.8.0 or higher
Steps to add plugin
- Add Plugin to existing cordova project by calling
Cordova plugin add https://innersource.accenture.com/cio-security-architecture/eso-library-for-cordova.git
- Update java script to call SSO plugin
- clientId, clientSecret, callbackUri are all strings. The Uri should not be escaped.
- clientScopes is an array of strings.
- Production flag is a Boolean (true/false)
sso.getToken(function(token) {
//handle token
}, function(error) {
//handle error
}, [CLIENT ID], [CLIENT SECRET], [Array of client scopes], [Callback URI],[ Production flag]);
Please note that this plugin makes a network call to validate the token, so do not call it every time you need a token. The token should be cached in memory and this plugin called on application launch and whenever you receive a 401 HTTP error.
Click here to see sample application one and sample application two
To obtain a clientId, clientSecret, callbackURI and scopes for your services click this link and fill out the forms.
CI
iOS
There is an occasional issue with the hook not triggering with the plugin (we are working on it) but to ensure no issues add the following steps to your CI…
rm plugin
rm platform
add platform
add plugin
or
- Please ensure you are not adding and/or removing platforms inside the CI job
- Please ensure you are not adding and/or removing plugins inside the CI job
ESO Plugin Maintenance guide
How to update staging and production URLs
iOS
- Checkout Plugin InnerSource Repo into
[directory]
using git - Open
[directory]/src/ios/SSOHelper.m
- There you will see
NSString* const SSO_AUTORIZATION_CODE_URI_STAGING = @"https://federation-sts-stage.accenture.com/oauth/ls/connect/authorize";
NSString* const SSO_TOKEN_REQUEST_URI_STAGING = @"https://federation-sts-stage.accenture.com/oauth/ls/connect/token";
NSString* const SSO_TOKEN_VALIDATION_URI_STAGING = @"https://federation-sts-stage.accenture.com/oauth/ls/connect/accesstokenvalidation";
NSString* const SSO_AUTORIZATION_CODE_URI_PRODUCTION = @"https://federation-sts.accenture.com/oauth/ls/connect/authorize";
NSString* const SSO_TOKEN_REQUEST_URI_PRODUCTION = @"https://federation-sts.accenture.com/oauth/ls/connect/token";
NSString* const SSO_TOKEN_VALIDATION_URI_PRODUCTION = @"https://federation-sts.accenture.com/oauth/ls/connect/accesstokenvalidation";
- Update them to the desired values
- Commit them using git and push them to the origin (innersource)
Android
- Checkout Plugin InnerSource Repo into
[directory]
using git - Open
[directory]/src/ios/SSOHelper.m
- There you will see
NSString* const SSO_AUTORIZATION_CODE_URI_STAGING = @"https://federation-sts-stage.accenture.com/oauth/ls/connect/authorize";
NSString* const SSO_TOKEN_REQUEST_URI_STAGING = @"https://federation-sts-stage.accenture.com/oauth/ls/connect/token";
NSString* const SSO_TOKEN_VALIDATION_URI_STAGING = @"https://federation-sts-stage.accenture.com/oauth/ls/connect/accesstokenvalidation";
NSString* const SSO_AUTORIZATION_CODE_URI_PRODUCTION = @"https://federation-sts.accenture.com/oauth/ls/connect/authorize";
NSString* const SSO_TOKEN_REQUEST_URI_PRODUCTION = @"https://federation-sts.accenture.com/oauth/ls/connect/token";
NSString* const SSO_TOKEN_VALIDATION_URI_PRODUCTION = @"https://federation-sts.accenture.com/oauth/ls/connect/accesstokenvalidation";
- Update them to the desired values
- Commit them using git and push them to the origin (innersource)
After you make changes
Update plugin version
- Checkout Plugin InnerSource Repo into
[directory]
using git - Open
[directory]/plugin.xml
- There you will see
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="com.accenture.cordova.plugin.sso"
version="1.0.0">