@okta/okta-auth-js
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -12,3 +12,3 @@ module.exports = { | ||
"CACHE_STORAGE_NAME": "okta-cache-storage", | ||
"SDK_VERSION": "2.0.1" | ||
"SDK_VERSION": "2.1.0" | ||
}; |
@@ -25,7 +25,4 @@ /*! | ||
try { | ||
if (storageUtil.getLocalStorage()) { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
var storage = storageUtil.getLocalStorage(); | ||
return storageUtil.testStorage(storage); | ||
} catch (e) { | ||
@@ -38,7 +35,4 @@ return false; | ||
try { | ||
if (storageUtil.getSessionStorage()) { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
var storage = storageUtil.getSessionStorage(); | ||
return storageUtil.testStorage(storage); | ||
} catch (e) { | ||
@@ -78,2 +72,13 @@ return false; | ||
storageUtil.testStorage = function(storage) { | ||
var key = 'okta-test-storage'; | ||
try { | ||
storage.setItem(key, key); | ||
storage.removeItem(key); | ||
return true; | ||
} catch (e) { | ||
return false; | ||
} | ||
}; | ||
module.exports = storageUtil; |
@@ -211,4 +211,5 @@ /*! | ||
function getDefaultOAuthParams(sdk, oauthOptions) { | ||
oauthOptions = util.clone(oauthOptions) || {}; | ||
function getDefaultOAuthParams(sdk, options) { | ||
var oauthOptions = util.clone(options) || {}; | ||
oauthOptions = util.removeNils(oauthOptions); | ||
@@ -369,2 +370,3 @@ var defaults = { | ||
function getOrigin(url) { | ||
/* eslint-disable-next-line no-useless-escape */ | ||
var originRegex = /^(https?\:\/\/)?([^:\/?#]*(?:\:[0-9]+)?)/; | ||
@@ -420,3 +422,4 @@ return originRegex.exec(url)[0]; | ||
var popupDeferred = Q.defer(); | ||
function hasClosed(win) { // eslint-disable-line no-inner-declarations | ||
/* eslint-disable-next-line no-case-declarations, no-inner-declarations */ | ||
function hasClosed(win) { | ||
if (win.closed) { | ||
@@ -504,3 +507,4 @@ popupDeferred.reject(new AuthSdkError('Unable to parse OAuth flow response')); | ||
clientId: oauthParams.clientId, | ||
urls: urls | ||
urls: urls, | ||
ignoreSignature: oauthParams.ignoreSignature | ||
})); | ||
@@ -507,0 +511,0 @@ |
@@ -16,3 +16,3 @@ /*! | ||
util.base64UrlToBase64 = function(b64u) { | ||
return b64u.replace(/\-/g, '+').replace(/_/g, '/'); | ||
return b64u.replace(/-/g, '+').replace(/_/g, '/'); | ||
}; | ||
@@ -19,0 +19,0 @@ |
{ | ||
"name": "@okta/okta-auth-js", | ||
"description": "The Okta Auth SDK", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"homepage": "https://github.com/okta/okta-auth-js", | ||
@@ -17,8 +17,7 @@ "license": "Apache-2.0", | ||
"lint": "eslint .", | ||
"lint:fix": "eslint --fix .", | ||
"lint:report": "eslint -f checkstyle -o build2/reports/lint/eslint-checkstyle-result.xml .", | ||
"test": "grunt test", | ||
"build": "webpack --config webpack.config.js", | ||
"build:tests": "webpack --config webpack.test.config.js", | ||
"prepublish": "node ./writeConfig.js && grunt shell:UMDNoDependencies" | ||
"test": "jest", | ||
"test:report": "yarn test --ci --silent || true", | ||
"build": "node ./writeConfig.js && webpack --config webpack.config.js", | ||
"prepublish": "yarn build" | ||
}, | ||
@@ -41,14 +40,8 @@ "author": "Okta", | ||
"devDependencies": { | ||
"eslint": "2.10.2", | ||
"grunt": "0.4.5", | ||
"grunt-cli": "1.2.0", | ||
"grunt-contrib-jasmine": "1.1.0", | ||
"grunt-shell": "1.3.0", | ||
"jquery": "2.1.4", | ||
"eslint": "5.6.1", | ||
"jest": "^23.6.0", | ||
"jest-junit": "^5.0.0", | ||
"jquery": "3.3.1", | ||
"json-loader": "0.5.4", | ||
"lodash": "4.10.0", | ||
"moment": "2.12.0", | ||
"normalize-url": "1.4.1", | ||
"semver": "5.1.0", | ||
"sinon": "1.16.0", | ||
"lodash": "4.17.11", | ||
"webpack": "1.13.0" | ||
@@ -68,6 +61,23 @@ }, | ||
}, | ||
"jest": { | ||
"coverageDirectory": "./build2/reports/coverage", | ||
"restoreMocks": true, | ||
"moduleNameMapper": { | ||
"^OktaAuth(.*)$": "<rootDir>/jquery/$1" | ||
}, | ||
"testMatch": [ | ||
"**/test/spec/*.js" | ||
], | ||
"reporters": [ | ||
"default", | ||
"jest-junit" | ||
] | ||
}, | ||
"jest-junit": { | ||
"output": "./build2/reports/unit/junit-result.xml" | ||
}, | ||
"okta": { | ||
"commitSha": "f3efeb731d1e0de3e9b28cf2d5ea5bec9b9edd0e", | ||
"fullVersion": "2.0.1-20180828171753-f3efeb7" | ||
"commitSha": "c38400687ce30bfcde17272511676f8dfa60d28b", | ||
"fullVersion": "2.1.0-20181107001214-c384006" | ||
} | ||
} |
@@ -62,6 +62,10 @@ [<img src="https://devforum.okta.com/uploads/oktadev/original/1X/bf54a16b5fda189e4ad2706fb57cbb7a1e5b8deb.png" align="right" width="256px"/>](https://devforum.okta.com/) | ||
# Run this command in your project root folder. | ||
npm install @okta/okta-auth-js --save | ||
# yarn | ||
yarn add --save @okta/okta-auth-js | ||
# npm | ||
npm install --save @okta/okta-auth-js | ||
``` | ||
After running `npm install`, the minified auth client will be installed to `node_modules/@okta/okta-auth-js/dist`. You can copy the `dist` contents to a publicly hosted directory. However, if you're using a bundler like [Webpack](https://webpack.github.io/) or [Browserify](http://browserify.org/), you can simply import the module using CommonJS. | ||
After installing `@okta/okta-auth-js`, the minified auth client will be installed to `node_modules/@okta/okta-auth-js/dist`. You can copy the `dist` contents to a publicly hosted directory. However, if you're using a bundler like [Webpack](https://webpack.github.io/) or [Browserify](http://browserify.org/), you can simply import the module using CommonJS. | ||
@@ -1409,3 +1413,3 @@ ```javascript | ||
Parses the access or ID Tokens from the url after a successful authentication redirect. | ||
Parses the access or ID Tokens from the url after a successful authentication redirect. If an ID token is present, it will be [verified and validated](https://github.com/okta/okta-auth-js/blob/master/lib/token.js#L186-L190) before available for use. | ||
@@ -1474,4 +1478,6 @@ ```javascript | ||
Verify the validity of an ID token's claims and check the signature on browsers that support web cryptography. | ||
Manually verify the validity of an ID token's claims and check the signature on browsers that support web cryptography. | ||
> **Note:** Token validation occurs [automatically](https://github.com/okta/okta-auth-js/blob/master/lib/token.js#L186-L190) when tokens are returned via `getWithoutPrompt`, `getWithPopup`, and `getWithRedirect`. | ||
* `idTokenObject` - an ID token returned by this library. note: this is not the raw ID token JWT | ||
@@ -1622,8 +1628,7 @@ * `validationOptions` - Optional object to assert ID token claim values. Defaults to the configuration passed in during client instantiation. | ||
# Navigate into the new `okta-auth-js` filder, and install Okta node dependencies | ||
# Navigate into the new `okta-auth-js` filder | ||
cd okta-auth-js | ||
npm install | ||
# Build the SDK. The output will be under `dist` | ||
npm run build | ||
# Install Okta node dependencies and SDK will be built under `dist` | ||
yarn install | ||
``` | ||
@@ -1635,5 +1640,5 @@ | ||
| --------------------- | ------------------------------ | | ||
| `npm run build` | Build the SDK with a sourcemap | | ||
| `npm test` | Run unit tests using PhantomJS | | ||
| `npm run lint:report` | Run eslint linting tests | | ||
| `yarn build` | Build the SDK with a sourcemap | | ||
| `yarn test` | Run unit tests using Jest | | ||
| `yarn lint` | Run eslint linting | | ||
@@ -1640,0 +1645,0 @@ ## Contributing |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
875529
7
40
2732
1648