Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Commit

Permalink
[okta-angular] Release 3.0.0
Browse files Browse the repository at this point in the history
update authJS@4.0.0

updates @okta/configuration-validation@1.0.0

updates test app to ng@7

service inherits from okta-auth-js instance
  • Loading branch information
aarongranick-okta committed Sep 2, 2020
1 parent 1244b68 commit 3a134b2
Show file tree
Hide file tree
Showing 23 changed files with 2,460 additions and 1,661 deletions.
15 changes: 14 additions & 1 deletion packages/okta-angular/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
# Pending
# 3.0.0

### Features

[#778](https://github.com/okta/okta-oidc-js/pull/778) `OktaAuthService` inherits from the `OktaAuth` service exported by [@okta/okta-auth-js](https://github.com/okta/okta-auth-js) making the full [configuration](https://github.com/okta/okta-auth-js#configuration-reference) and [api](https://github.com/okta/okta-auth-js#api-reference) available on `OktaAuthService`

### Breaking Changes

[#778](https://github.com/okta/okta-oidc-js/pull/778) `@okta/okta-auth-js` is updated to version 4.0.0 and `@okta/configuration-validation` is updated to 1.0.0. These updates contain several breaking changes:

- Typescript definitions are now included. If you were providing your own definitions for `@okta/okta-auth-js` or `@okta/configuration-validation` you should remove these locally defined types in favor of the types exported by this library.

- onSessionExpired option has been removed. [TokenManager events](https://github.com/okta/okta-auth-js#tokenmanageronevent-callback-context) can be used to detect and handle token renewal errors.


### 2.2.0

Expand Down
7 changes: 5 additions & 2 deletions packages/okta-angular/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ All of these features are supported by this SDK. Additionally, using this SDK, y
This library currently supports:

- [OAuth 2.0 Implicit Flow](https://tools.ietf.org/html/rfc6749#section-1.3.2)
- [OAuth 2.0 Authorization Code Flow](https://tools.ietf.org/html/rfc6749#section-1.3.1) with [Proof Key for Code Exchange (PKCE)](https://tools.ietf.org/html/rfc7636)
- [OAuth 2.0 Authorization Code Flow](https://tools.ietf.org/html/rfc6749#section-1.3.1) with [Proof Key for Code Exchange (PKCE)](https://tools.ietf.org/html/rfc7636)

> This library has been tested for compatibility with the following Angular versions: 4, 5, 6, 7, 8, 9
> :warning: Angular versions older than 7 may not be fully compatible with all dependencies of this library, due to an older Typescript version. You may be able to workaround this issue by setting `skipLibChecks: true` in your `tsconfig.json` file.
## Getting Started

Expand Down Expand Up @@ -314,7 +315,9 @@ const oktaConfig = {

### `OktaAuthService`

In your components, your can take advantage of all of `okta-angular`'s features by importing the `OktaAuthService`. The example below shows connecting two buttons to handle **login** and **logout**:
In your components, your can take advantage of all of `okta-angular`'s features by importing the `OktaAuthService`. The `OktaAuthService` inherits from the `OktaAuth` service exported by [@okta/okta-auth-js](https://github.com/okta/okta-auth-js) making the full [configuration](https://github.com/okta/okta-auth-js#configuration-reference) and [api](https://github.com/okta/okta-auth-js#api-reference) available on `OktaAuthService`.

The example below shows connecting two buttons to handle **login** and **logout**:

```typescript
// sample.component.ts
Expand Down
2 changes: 1 addition & 1 deletion packages/okta-angular/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ shell.mkdir(`-p`, `./${OUT_DIR}`);
// https://github.com/palantir/tslint/blob/master/src/configs/recommended.ts
// https://github.com/mgechev/codelyzer
shell.echo(`Start TSLint`);
shell.exec(`tslint -p tsconfig.json -t stylish src/**/*.ts`);
shell.exec(`yarn lint`);
shell.echo(chalk.green(`TSLint completed`));

shell.cp(`-Rf`, [`src`, `*.ts`, `*.json`], `${OUT_DIR}`);
Expand Down
21 changes: 14 additions & 7 deletions packages/okta-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@okta/okta-angular",
"private": true,
"version": "2.2.0",
"version": "3.0.0",
"description": "Angular support for Okta",
"main": "./bundles/okta-angular.umd.js",
"module": "./fesm5/okta-angular.js",
Expand All @@ -12,6 +12,7 @@
"fesm2015": "./fesm2015/okta-angular.js",
"typings": "./okta-angular.d.ts",
"scripts": {
"clean": "rimraf dist/",
"build:package-info": "node ../../util/write-package-info.js . src/okta/packageInfo.ts",
"lint": "tslint -p tsconfig.json -t stylish src/**/*.ts",
"prebuild": "yarn build:package-info",
Expand Down Expand Up @@ -39,8 +40,8 @@
],
"license": "Apache-2.0",
"dependencies": {
"@okta/configuration-validation": "^0.4.1",
"@okta/okta-auth-js": "^3.2.3",
"@okta/configuration-validation": "^1.0.0",
"@okta/okta-auth-js": "^4.0.0",
"tslib": "^1.9.0"
},
"devDependencies": {
Expand All @@ -67,14 +68,15 @@
"jest-preset-angular": "^7.1.1",
"raw-loader": "1.0.0",
"reflect-metadata": "0.1.13",
"rimraf": "^3.0.2",
"rollup": "1.29.0",
"rollup-plugin-license": "0.8.1",
"rollup-plugin-sourcemaps": "0.4.2",
"rxjs": "6.5.2",
"shelljs": "0.8.3",
"source-map-loader": "0.2.4",
"to-string-loader": "1.1.5",
"ts-loader": "6.0.1",
"ts-loader": "^8.0.3",
"tsickle": "0.33.0",
"tslint": "5.16.0",
"tslint-angular": "3.0.2",
Expand All @@ -92,6 +94,9 @@
"rxjs": ">=5.4.3"
},
"jest": {
"moduleNameMapper": {
"@okta/okta-auth-js": "<rootDir>/node_modules/@okta/okta-auth-js/dist/okta-auth-js.umd.js"
},
"restoreMocks": true,
"transform": {
"^.+\\.(ts|html)$": "ts-jest"
Expand All @@ -102,13 +107,15 @@
],
"globals": {
"ts-jest": {
"tsConfig": "<rootDir>/tsconfig.spec.json"
"tsConfig": "<rootDir>/test/spec/tsconfig.spec.json"
}
},
"preset": "jest-preset-angular",
"rootDir": "./test/spec",
"roots": [
"./test/spec"
],
"setupFilesAfterEnv": [
"../support/setupJest.ts"
"<rootDir>/test/support/setupJest.ts"
]
},
"sideEffects": false
Expand Down
6 changes: 0 additions & 6 deletions packages/okta-angular/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ export default {
}),
commonjs({
namedExports: {
'@okta/configuration-validation': [
'assertIssuer',
'assertClientId',
'assertRedirectUri',
'buildConfigObject'
]
}
}),
sourcemaps()
Expand Down

This file was deleted.

22 changes: 0 additions & 22 deletions packages/okta-angular/src/@types/okta__okta-auth-js/index.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/okta-angular/src/okta-angular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export { OktaAuthModule } from './okta/okta.module';
export { OktaAuthGuard } from './okta/okta.guard';
export { OktaAuthService } from './okta/services/okta.service';
export { OktaConfig, OKTA_CONFIG } from './okta/models/okta.config';
export { UserClaims } from './okta/models/user-claims';

// Okta View Components
export { OktaCallbackComponent } from './okta/components/callback.component';
Expand Down
20 changes: 2 additions & 18 deletions packages/okta-angular/src/okta/models/okta.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,19 @@

import { InjectionToken, Injector } from '@angular/core';
import { OktaAuthService } from '../services/okta.service';
import { OktaAuthOptions } from '@okta/okta-auth-js';

export type AuthRequiredFunction = (oktaAuth: OktaAuthService, injector: Injector) => void;
export type IsAuthenticatedFunction = (oktaAuth: OktaAuthService) => Promise<boolean>;
export type OnSessionExpiredFunction = () => void;

export interface TestingObject {
disableHttpsCheck: boolean;
}

export interface TokenManagerConfig {
autoRenew?: boolean;
secure?: boolean;
storage?: string;
}

export interface OktaConfig {
issuer?: string;
redirectUri?: string;
clientId?: string;
scope?: string;
scopes?: string[];
responseType?: any; // can be string or array
pkce?: boolean;
export interface OktaConfig extends OktaAuthOptions {
onAuthRequired?: AuthRequiredFunction;
testing?: TestingObject;
tokenManager?: TokenManagerConfig;
postLogoutRedirectUri?: string;
isAuthenticated?: IsAuthenticatedFunction;
onSessionExpired?: OnSessionExpiredFunction;
}

export const OKTA_CONFIG = new InjectionToken<OktaConfig>('okta.config.angular');
19 changes: 0 additions & 19 deletions packages/okta-angular/src/okta/models/token-manager.ts

This file was deleted.

27 changes: 0 additions & 27 deletions packages/okta-angular/src/okta/models/user-claims.ts

This file was deleted.

Loading

0 comments on commit 3a134b2

Please sign in to comment.