-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip * cleanup, fix * cleanup / reduce * simple test app, performs PKCE flow * lint * fix tests * npm start * save / load code verifier * polyfill webcrypto, TextEncoder to test computeChallenge * Add options to util: - generateIDtoken - bypassCrypto (will "ignoreSignature") - option for timeout on test - responseVars for XHR templates * test exchangeFortoken, fix minor bug * cleanup, fix tests * address review feedback * changes needed for fetch to handle token post * validate response types (allow 'code' in array) * Pkce2 (#210) * streamline pkce * fix/disable tests * PKCE flow configured by "grantType: authorization_code" on getWithRedirect * Update README.md * Add unit test for fetch request. Explicitly mock cross-fetch where needed. * enable tests (defaults to fragment mode for code now) * address review feedback * Add karma test for crypto/pkce which needs webcrypto Removes "peculiar" polyfill * browser tests for complete login flow, implicit & pkce * fix karma test * update README from review feedback * Adds tests for "validateOptions" * remove package-lock.json from test/app * use --prefix (easier to understand) * do not export pkce interface * fix test app * validate code_challenge_method against well-known configuration * verify functionality of getWithPopup() for PKCE and implicit * fix tests * support PKCE directly in getToken (for popup, frame, etc.) * Use crypto to generate super random string for verifier * remove breaking change: responseMode * Add tests for renew token * add test for error/iframe offline_access * nits * throw if using undefined storage name key * add method to test for PKCE support (+tests for features) * Add PKCE paragraph to README * withCredentials for reqwest / jquery httpRequestClients * remove features from server test * Throw error if trying to use PKCE on unsupported browser * Update README.md * PKCE supported: only throw in constructor * lint nits * Accept more query params in test app * nit * small fix for testApp * set values for scopes, responseType in test * udpate test app readme * disallow "code" responseType * add tests for base64 utils * review feedback * expect responseType=code when grantType=authorization_code * nits * getToken*: throw if PKCE not supported
- Loading branch information
1 parent
cac7ee7
commit 0a8a4e1
Showing
65 changed files
with
14,921 additions
and
779 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,6 @@ | |
/buildtools | ||
/dist | ||
/target | ||
/node_modules | ||
node_modules | ||
*.config.js | ||
/lib/config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/*! | ||
* Copyright (c) 2019-Present, Okta, Inc. and/or its affiliates. All rights reserved. | ||
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") | ||
* | ||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* | ||
* See the License for the specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
// Karma configuration file, see link for more information | ||
// http://karma-runner.github.io/3.0/config/configuration-file.html | ||
|
||
/* global __dirname */ | ||
var path = require('path'); | ||
var REPORTS_DIR = path.join(__dirname, 'build2', 'reports', 'karma'); | ||
|
||
var webpackConf = { | ||
devtool: 'inline-source-map', | ||
resolve: { | ||
alias: { | ||
'@okta/okta-auth-js': path.join(__dirname, 'lib/browser/browserIndex.js') | ||
} | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
use: { loader: 'istanbul-instrumenter-loader' }, | ||
enforce: 'post', | ||
include: [ | ||
path.resolve(__dirname, 'lib') | ||
] | ||
} | ||
] | ||
} | ||
}; | ||
|
||
module.exports = function (config) { | ||
config.set({ | ||
basePath: '', | ||
frameworks: ['jasmine', 'jquery-3.3.1'], | ||
plugins: [ | ||
'karma-jasmine', | ||
'karma-chrome-launcher', | ||
'karma-coverage-istanbul-reporter', | ||
'karma-webpack', | ||
'karma-jquery', | ||
'karma-sourcemap-loader' | ||
], | ||
files: [ | ||
{ pattern: './test/karma/main.js', watched: false } | ||
], | ||
preprocessors: { | ||
'test/karma/main.js': ['webpack', 'sourcemap'] | ||
}, | ||
webpack: webpackConf, | ||
webpackMiddleware: { | ||
stats: 'normal', | ||
}, | ||
client: { | ||
// Passing specific test to run | ||
// but this works only with `karma start`, not `karma run`. | ||
test: config.test, | ||
clearContext: false // leave Jasmine Spec Runner output visible in browser | ||
}, | ||
coverageIstanbulReporter: { | ||
dir: REPORTS_DIR, | ||
reports: [ 'html', 'lcovonly' ], | ||
fixWebpackSourcePaths: true | ||
}, | ||
reporters: ['progress', 'coverage-istanbul'], | ||
port: 9876, | ||
colors: true, | ||
logLevel: config.LOG_INFO, | ||
autoWatch: true, | ||
browsers: ['ChromeHeadlessNoSandbox'], | ||
customLaunchers: { | ||
ChromeHeadlessNoSandbox: { | ||
base: 'ChromeHeadless', | ||
flags: ['--no-sandbox'] | ||
} | ||
}, | ||
singleRun: false | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.