├── projects ├── angular-auth-oidc-client │ ├── README.md │ ├── src │ │ ├── lib │ │ │ ├── logging │ │ │ │ ├── log-level.ts │ │ │ │ ├── abstract-logger.service.ts │ │ │ │ └── console-logger.service.ts │ │ │ ├── login │ │ │ │ ├── par │ │ │ │ │ └── par-response.ts │ │ │ │ ├── popup │ │ │ │ │ ├── popup-result.ts │ │ │ │ │ └── popup-options.ts │ │ │ │ └── login-response.ts │ │ │ ├── public-events │ │ │ │ ├── notification.ts │ │ │ │ └── event-types.ts │ │ │ ├── flows │ │ │ │ ├── flows.models.ts │ │ │ │ └── callback-handling │ │ │ │ │ └── error-helper.ts │ │ │ ├── user-data │ │ │ │ └── userdata-result.ts │ │ │ ├── utils │ │ │ │ ├── collections │ │ │ │ │ └── collections.helper.ts │ │ │ │ ├── object │ │ │ │ │ └── object.helper.ts │ │ │ │ ├── redirect │ │ │ │ │ └── redirect.service.ts │ │ │ │ ├── platform-provider │ │ │ │ │ └── platform.provider.ts │ │ │ │ ├── crypto │ │ │ │ │ └── crypto.service.ts │ │ │ │ ├── url │ │ │ │ │ ├── uri-encoder.ts │ │ │ │ │ └── current-url.service.ts │ │ │ │ └── regex │ │ │ │ │ └── regex.helper.ts │ │ │ ├── validation │ │ │ │ ├── jwtkeys.ts │ │ │ │ ├── state-validation-result.ts │ │ │ │ └── validation-result.ts │ │ │ ├── auth-state │ │ │ │ ├── auth-state.ts │ │ │ │ └── auth-result.ts │ │ │ ├── config │ │ │ │ ├── auth-well-known │ │ │ │ │ └── auth-well-known-endpoints.ts │ │ │ │ └── validation │ │ │ │ │ ├── rule.ts │ │ │ │ │ └── rules │ │ │ │ │ ├── ensure-clientId.rule.ts │ │ │ │ │ ├── ensure-authority.rule.ts │ │ │ │ │ └── ensure-redirect-url.rule.ts │ │ │ ├── auth-options.ts │ │ │ ├── auth-config.spec.ts │ │ │ ├── api │ │ │ │ └── http-base.service.ts │ │ │ ├── storage │ │ │ │ ├── default-localstorage.service.ts │ │ │ │ └── default-sessionstorage.service.ts │ │ │ ├── auth.module.ts │ │ │ └── auth-config.ts │ │ ├── public-api.ts │ │ ├── test │ │ │ └── create-retriable-stream.helper.ts │ │ └── test.ts │ ├── tsconfig.lib.prod.json │ ├── tsconfig.spec.json │ ├── ng-package.json │ └── tsconfig.lib.json ├── sample-code-flow-auth0 │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── home │ │ │ │ ├── home.component.css │ │ │ │ ├── home.component.html │ │ │ │ └── home.component.spec.ts │ │ │ ├── unauthorized │ │ │ │ ├── unauthorized.component.css │ │ │ │ ├── unauthorized.component.html │ │ │ │ └── unauthorized.component.ts │ │ │ ├── app.component.html │ │ │ └── app.component.ts │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ └── test.ts │ ├── tsconfig.app.json │ └── tsconfig.spec.json ├── sample-code-flow-azuread │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── forbidden │ │ │ │ ├── forbidden.component.css │ │ │ │ ├── forbidden.component.html │ │ │ │ ├── forbidden.component.ts │ │ │ │ └── forbidden.component.spec.ts │ │ │ ├── protected │ │ │ │ ├── protected.component.css │ │ │ │ ├── protected.component.html │ │ │ │ ├── protected.component.ts │ │ │ │ └── protected.component.spec.ts │ │ │ ├── unauthorized │ │ │ │ ├── unauthorized.component.css │ │ │ │ ├── unauthorized.component.html │ │ │ │ └── unauthorized.component.ts │ │ │ ├── home │ │ │ │ └── home.component.html │ │ │ ├── app.component.css │ │ │ └── app.component.html │ │ ├── styles.css │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── main.ts │ │ └── test.ts │ ├── tsconfig.app.json │ └── tsconfig.spec.json ├── sample-code-flow-par │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── home │ │ │ │ ├── home.component.css │ │ │ │ └── home.component.spec.ts │ │ │ ├── unauthorized │ │ │ │ ├── unauthorized.component.css │ │ │ │ ├── unauthorized.component.html │ │ │ │ └── unauthorized.component.ts │ │ │ ├── app.component.html │ │ │ └── app.component.ts │ │ ├── styles.css │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ └── test.ts │ ├── tsconfig.app.json │ └── tsconfig.spec.json ├── sample-code-flow-popup │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── app-routing.module.ts │ │ │ └── app.module.ts │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ └── test.ts │ ├── tsconfig.app.json │ └── tsconfig.spec.json ├── sample-code-flow-auto-login │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── home │ │ │ │ ├── home.component.css │ │ │ │ ├── home.component.html │ │ │ │ └── home.component.spec.ts │ │ │ ├── customers │ │ │ │ ├── customers.component.css │ │ │ │ ├── customers.component.html │ │ │ │ ├── customers.component.ts │ │ │ │ ├── customers.module.ts │ │ │ │ ├── customers-routing.module.ts │ │ │ │ └── customers.component.spec.ts │ │ │ ├── forbidden │ │ │ │ ├── forbidden.component.css │ │ │ │ ├── forbidden.component.html │ │ │ │ └── forbidden.component.ts │ │ │ ├── protected │ │ │ │ ├── protected.component.css │ │ │ │ ├── protected.component.html │ │ │ │ └── protected.component.ts │ │ │ ├── unauthorized │ │ │ │ ├── unauthorized.component.css │ │ │ │ ├── unauthorized.component.html │ │ │ │ └── unauthorized.component.ts │ │ │ ├── navigation │ │ │ │ └── navigation.component.css │ │ │ └── app.component.html │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── favicon.ico │ │ ├── main.ts │ │ └── test.ts │ ├── tsconfig.app.json │ └── tsconfig.spec.json ├── sample-code-flow-azure-b2c │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── forbidden │ │ │ │ ├── forbidden.component.css │ │ │ │ ├── forbidden.component.html │ │ │ │ ├── forbidden.component.ts │ │ │ │ └── forbidden.component.spec.ts │ │ │ ├── protected │ │ │ │ ├── protected.component.css │ │ │ │ ├── protected.component.html │ │ │ │ ├── protected.component.ts │ │ │ │ └── protected.component.spec.ts │ │ │ ├── unauthorized │ │ │ │ ├── unauthorized.component.css │ │ │ │ ├── unauthorized.component.html │ │ │ │ └── unauthorized.component.ts │ │ │ ├── home │ │ │ │ └── home.component.html │ │ │ ├── app.component.css │ │ │ ├── app.component.ts │ │ │ └── app.component.html │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── favicon.ico │ │ ├── main.ts │ │ └── test.ts │ ├── tsconfig.app.json │ └── tsconfig.spec.json ├── sample-code-flow-http-config │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── home │ │ │ │ ├── home.component.css │ │ │ │ └── home.component.spec.ts │ │ │ ├── unauthorized │ │ │ │ ├── unauthorized.component.css │ │ │ │ ├── unauthorized.component.html │ │ │ │ └── unauthorized.component.ts │ │ │ └── app.component.html │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ └── test.ts │ ├── tsconfig.app.json │ └── tsconfig.spec.json ├── sample-code-flow-lazy-loaded │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── lazy │ │ │ │ ├── lazy.component.css │ │ │ │ ├── lazy.component.html │ │ │ │ ├── lazy.module.ts │ │ │ │ ├── lazy-routing.module.ts │ │ │ │ └── lazy.component.spec.ts │ │ │ ├── app.component.html │ │ │ ├── app-routing.module.ts │ │ │ ├── app.module.ts │ │ │ └── auth-config.module.ts │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ └── test.ts │ ├── tsconfig.app.json │ └── tsconfig.spec.json ├── sample-code-flow-multi-AAD │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── home │ │ │ │ ├── home.component.css │ │ │ │ ├── home.component.html │ │ │ │ └── home.component.spec.ts │ │ │ ├── unauthorized │ │ │ │ ├── unauthorized.component.css │ │ │ │ ├── unauthorized.component.html │ │ │ │ └── unauthorized.component.ts │ │ │ ├── app.component.html │ │ │ └── app.component.ts │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ └── test.ts │ ├── tsconfig.app.json │ └── tsconfig.spec.json ├── sample-code-flow-multi-iframe │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── home │ │ │ │ ├── home.component.css │ │ │ │ ├── home.component.html │ │ │ │ └── home.component.spec.ts │ │ │ ├── unauthorized │ │ │ │ ├── unauthorized.component.css │ │ │ │ ├── unauthorized.component.html │ │ │ │ └── unauthorized.component.ts │ │ │ ├── app.component.html │ │ │ └── app.component.ts │ │ ├── styles.css │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ └── test.ts │ ├── tsconfig.app.json │ └── tsconfig.spec.json ├── sample-code-flow-standalone │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── home │ │ │ │ ├── home.component.css │ │ │ │ ├── home.component.html │ │ │ │ ├── home.component.ts │ │ │ │ └── home.component.spec.ts │ │ │ ├── customers │ │ │ │ ├── customers.component.css │ │ │ │ ├── customers.component.html │ │ │ │ ├── customers.routes.ts │ │ │ │ ├── customers.component.ts │ │ │ │ └── customers.component.spec.ts │ │ │ ├── forbidden │ │ │ │ ├── forbidden.component.css │ │ │ │ ├── forbidden.component.html │ │ │ │ └── forbidden.component.ts │ │ │ ├── protected │ │ │ │ ├── protected.component.css │ │ │ │ ├── protected.component.html │ │ │ │ └── protected.component.ts │ │ │ ├── unauthorized │ │ │ │ ├── unauthorized.component.css │ │ │ │ ├── unauthorized.component.html │ │ │ │ └── unauthorized.component.ts │ │ │ ├── navigation │ │ │ │ └── navigation.component.css │ │ │ └── app.component.html │ │ ├── styles.css │ │ ├── favicon.ico │ │ ├── main.ts │ │ └── test.ts │ ├── tsconfig.app.json │ └── tsconfig.spec.json ├── sample-implicit-flow-google │ ├── src │ │ ├── assets │ │ │ ├── .gitkeep │ │ │ └── damienbod.jpg │ │ ├── app │ │ │ ├── auto-login │ │ │ │ ├── auto-login.component.html │ │ │ │ └── auto-login.component.ts │ │ │ ├── forbidden │ │ │ │ ├── forbidden.component.html │ │ │ │ └── forbidden.component.ts │ │ │ ├── unauthorized │ │ │ │ ├── unauthorized.component.html │ │ │ │ └── unauthorized.component.ts │ │ │ ├── home │ │ │ │ └── home.component.html │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ └── app.routes.ts │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── favicon.ico │ │ ├── main.ts │ │ └── test.ts │ ├── tsconfig.app.json │ └── tsconfig.spec.json ├── sample-code-flow-multi-Auth0-ID4 │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── home │ │ │ │ ├── home.component.css │ │ │ │ └── home.component.spec.ts │ │ │ ├── unauthorized │ │ │ │ ├── unauthorized.component.css │ │ │ │ ├── unauthorized.component.html │ │ │ │ └── unauthorized.component.ts │ │ │ ├── app.component.html │ │ │ └── app.component.ts │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ └── test.ts │ ├── tsconfig.app.json │ └── tsconfig.spec.json ├── sample-code-flow-multi-Azure-B2C │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── home │ │ │ │ ├── home.component.css │ │ │ │ ├── home.component.html │ │ │ │ └── home.component.spec.ts │ │ │ ├── unauthorized │ │ │ │ ├── unauthorized.component.css │ │ │ │ ├── unauthorized.component.html │ │ │ │ └── unauthorized.component.ts │ │ │ ├── app.component.html │ │ │ └── app.component.ts │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ └── test.ts │ ├── tsconfig.app.json │ └── tsconfig.spec.json ├── sample-code-flow-refresh-tokens │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── home │ │ │ │ ├── home.component.css │ │ │ │ └── home.component.spec.ts │ │ │ ├── unauthorized │ │ │ │ ├── unauthorized.component.css │ │ │ │ ├── unauthorized.component.html │ │ │ │ └── unauthorized.component.ts │ │ │ ├── app.component.html │ │ │ └── app.component.ts │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ └── test.ts │ ├── tsconfig.app.json │ └── tsconfig.spec.json ├── sample-implicit-flow-silent-renew │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── home │ │ │ │ ├── home.component.css │ │ │ │ ├── home.component.spec.ts │ │ │ │ └── home.component.html │ │ │ ├── unauthorized │ │ │ │ ├── unauthorized.component.css │ │ │ │ ├── unauthorized.component.html │ │ │ │ └── unauthorized.component.ts │ │ │ ├── app.component.html │ │ │ └── app.component.ts │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ └── test.ts │ ├── tsconfig.app.json │ └── tsconfig.spec.json ├── sample-code-flow-auto-login-all-routes │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── home │ │ │ │ ├── home.component.css │ │ │ │ ├── home.component.html │ │ │ │ └── home.component.spec.ts │ │ │ ├── callback │ │ │ │ ├── callback.component.css │ │ │ │ ├── callback.component.html │ │ │ │ ├── callback.component.ts │ │ │ │ └── callback.component.spec.ts │ │ │ ├── customers │ │ │ │ ├── customers.component.css │ │ │ │ ├── customers.component.html │ │ │ │ ├── customers.component.ts │ │ │ │ ├── customers.module.ts │ │ │ │ ├── customers-routing.module.ts │ │ │ │ └── customers.component.spec.ts │ │ │ ├── forbidden │ │ │ │ ├── forbidden.component.css │ │ │ │ ├── forbidden.component.html │ │ │ │ └── forbidden.component.ts │ │ │ ├── protected │ │ │ │ ├── protected.component.css │ │ │ │ ├── protected.component.html │ │ │ │ └── protected.component.ts │ │ │ ├── unauthorized │ │ │ │ ├── unauthorized.component.css │ │ │ │ ├── unauthorized.component.html │ │ │ │ └── unauthorized.component.ts │ │ │ ├── navigation │ │ │ │ └── navigation.component.css │ │ │ ├── app.component.html │ │ │ └── app.component.ts │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── favicon.ico │ │ ├── main.ts │ │ └── test.ts │ ├── tsconfig.app.json │ └── tsconfig.spec.json ├── sample-code-flow-multi-Auth0-ID4-popup │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── home │ │ │ │ ├── home.component.css │ │ │ │ └── home.component.spec.ts │ │ │ ├── unauthorized │ │ │ │ ├── unauthorized.component.css │ │ │ │ ├── unauthorized.component.html │ │ │ │ └── unauthorized.component.ts │ │ │ └── app.component.html │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ └── test.ts │ ├── tsconfig.app.json │ └── tsconfig.spec.json ├── integration-tests │ ├── test-idp-server │ │ ├── .gitignore │ │ ├── restart.sh │ │ ├── tsconfig.json │ │ ├── package.json │ │ └── src │ │ │ └── index.ts │ ├── tsconfig.json │ ├── tsconfig.app.json │ └── tsconfig.spec.json └── schematics │ ├── src │ ├── ng-add │ │ ├── files │ │ │ ├── auth-config-standalone │ │ │ │ └── auth.config.__ts__ │ │ │ └── auth-config-module │ │ │ │ └── auth-config.module.__ts__ │ │ ├── index.ts │ │ ├── actions │ │ │ └── install-dependencies.ts │ │ └── models │ │ │ └── ng-add-options.ts │ └── collection.json │ ├── package.json │ └── tsconfig.json ├── docs └── site │ └── angular-auth-oidc-client │ ├── static │ ├── .nojekyll │ └── img │ │ ├── favicon.ico │ │ ├── docusaurus.png │ │ ├── angular-auth-logo.png │ │ └── tutorial │ │ ├── localeDropdown.png │ │ └── docsVersionDropdown.png │ ├── docs │ ├── samples │ │ └── _category_.json │ ├── migrations │ │ ├── _category_.json │ │ ├── v19-to-v20.md │ │ ├── v12-to-v13.md │ │ └── v16-to-v17.md │ └── documentation │ │ └── _category_.json │ ├── babel.config.js │ ├── src │ └── pages │ │ ├── markdown-page.md │ │ ├── index.js │ │ └── index.module.css │ ├── .gitignore │ └── sidebars.js ├── .prettierrc ├── license-banner.txt ├── .github ├── angular-auth-logo.png ├── angular-auth-oidc-client-schematics-720.gif └── ISSUE_TEMPLATE │ ├── refactoring.md │ ├── question.md │ └── feature_request.md ├── .prettierignore ├── .editorconfig ├── SECURITY.md ├── certs └── Readme.md └── tools └── build-all-angular-projects.js /projects/angular-auth-oidc-client/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/site/angular-auth-oidc-client/static/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auth0/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-par/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-popup/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auth0/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-http-config/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-lazy-loaded/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-AAD/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-iframe/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-par/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-popup/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-google/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auth0/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-http-config/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-lazy-loaded/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-AAD/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Azure-B2C/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-par/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-refresh-tokens/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-silent-renew/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-AAD/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4-popup/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Azure-B2C/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-iframe/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-refresh-tokens/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-silent-renew/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-http-config/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-lazy-loaded/src/app/lazy/lazy.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4-popup/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Azure-B2C/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-iframe/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-refresh-tokens/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/app/customers/customers.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/app/forbidden/forbidden.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/app/protected/protected.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/src/app/forbidden/forbidden.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/src/app/protected/protected.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/src/app/forbidden/forbidden.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/src/app/protected/protected.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-par/src/app/unauthorized/unauthorized.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/app/customers/customers.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/app/forbidden/forbidden.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/app/protected/protected.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-silent-renew/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "es5" 4 | } 5 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auth0/src/app/unauthorized/unauthorized.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/src/app/unauthorized/unauthorized.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/src/app/unauthorized/unauthorized.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-AAD/src/app/unauthorized/unauthorized.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4-popup/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/callback/callback.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/app/unauthorized/unauthorized.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-http-config/src/app/unauthorized/unauthorized.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-iframe/src/app/unauthorized/unauthorized.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-refresh-tokens/src/app/unauthorized/unauthorized.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/app/unauthorized/unauthorized.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/customers/customers.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/forbidden/forbidden.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/protected/protected.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4/src/app/unauthorized/unauthorized.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Azure-B2C/src/app/unauthorized/unauthorized.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-silent-renew/src/app/unauthorized/unauthorized.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /license-banner.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * @license angular-auth-oidc-client 3 | * MIT license 4 | */ 5 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/unauthorized/unauthorized.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4-popup/src/app/unauthorized/unauthorized.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/integration-tests/test-idp-server/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ 3 | *.log 4 | .env 5 | tmp 6 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/app/customers/customers.component.html: -------------------------------------------------------------------------------- 1 |

customers works!

2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/app/protected/protected.component.html: -------------------------------------------------------------------------------- 1 |

protected works!

2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/src/app/forbidden/forbidden.component.html: -------------------------------------------------------------------------------- 1 |

forbidden works!

2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/src/app/protected/protected.component.html: -------------------------------------------------------------------------------- 1 |

protected works!

2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/src/app/forbidden/forbidden.component.html: -------------------------------------------------------------------------------- 1 |

forbidden works!

2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/src/app/protected/protected.component.html: -------------------------------------------------------------------------------- 1 |

protected works!

2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/app/customers/customers.component.html: -------------------------------------------------------------------------------- 1 |

customers works!

2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/app/protected/protected.component.html: -------------------------------------------------------------------------------- 1 |

protected works!

2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/src/app/unauthorized/unauthorized.component.html: -------------------------------------------------------------------------------- 1 |

unauthorized works!

2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/customers/customers.component.html: -------------------------------------------------------------------------------- 1 |

customers works!

2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/protected/protected.component.html: -------------------------------------------------------------------------------- 1 |

protected works!

2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/src/app/unauthorized/unauthorized.component.html: -------------------------------------------------------------------------------- 1 |

unauthorized works!

2 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-google/src/app/auto-login/auto-login.component.html: -------------------------------------------------------------------------------- 1 |
redirecting to login
2 | -------------------------------------------------------------------------------- /docs/site/angular-auth-oidc-client/docs/samples/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Samples", 3 | "position": 3 4 | } 5 | -------------------------------------------------------------------------------- /.github/angular-auth-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/.github/angular-auth-logo.png -------------------------------------------------------------------------------- /docs/site/angular-auth-oidc-client/docs/migrations/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Migrations", 3 | "position": 4 4 | } 5 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/app/navigation/navigation.component.css: -------------------------------------------------------------------------------- 1 | .nav-link { 2 | cursor: pointer; 3 | } 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-par/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/app/navigation/navigation.component.css: -------------------------------------------------------------------------------- 1 | .nav-link { 2 | cursor: pointer; 3 | } 4 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | /projects/schematics 2 | .gitkeep 3 | /**/favicon.ico 4 | /**/.browserslistrc 5 | /**/*.jpg 6 | /.github/* 7 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auth0/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auth0/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-par/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-popup/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-popup/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/navigation/navigation.component.css: -------------------------------------------------------------------------------- 1 | .nav-link { 2 | cursor: pointer; 3 | } 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-http-config/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-http-config/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-lazy-loaded/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-lazy-loaded/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-AAD/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-AAD/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-iframe/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-google/src/app/forbidden/forbidden.component.html: -------------------------------------------------------------------------------- 1 |
403: You have no rights to access this.
2 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-google/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-google/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-AAD/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

Multiple Azure AD clients

2 | 3 | 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Azure-B2C/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Azure-B2C/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-iframe/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-refresh-tokens/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-refresh-tokens/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-silent-renew/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-silent-renew/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/logging/log-level.ts: -------------------------------------------------------------------------------- 1 | export enum LogLevel { 2 | None, 3 | Debug, 4 | Warn, 5 | Error, 6 | } 7 | -------------------------------------------------------------------------------- /projects/integration-tests/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "exclude": [ 4 | "test-idp-server/**/*" 5 | ] 6 | } -------------------------------------------------------------------------------- /projects/sample-code-flow-auth0/src/app/unauthorized/unauthorized.component.html: -------------------------------------------------------------------------------- 1 |
401: You have no rights to access this. Please Login
2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4-popup/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4-popup/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-par/src/app/unauthorized/unauthorized.component.html: -------------------------------------------------------------------------------- 1 |
401: You have no rights to access this. Please Login
2 | -------------------------------------------------------------------------------- /docs/site/angular-auth-oidc-client/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')], 3 | }; 4 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/public-api.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Public API Surface of angular-auth-oidc-client 3 | */ 4 | 5 | export * from './lib'; 6 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/callback/callback.component.html: -------------------------------------------------------------------------------- 1 |

Setting everything up...you are getting redirected...

2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/app/unauthorized/unauthorized.component.html: -------------------------------------------------------------------------------- 1 |
401: You have no rights to access this. Please Login
2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-http-config/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

Sample Code Flow With Http Config

2 | 3 | 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-AAD/src/app/unauthorized/unauthorized.component.html: -------------------------------------------------------------------------------- 1 |
401: You have no rights to access this. Please Login
2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Azure-B2C/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

Multiple Azure AD B2C clients

2 | 3 | 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/app/unauthorized/unauthorized.component.html: -------------------------------------------------------------------------------- 1 |
401: You have no rights to access this. Please Login
2 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-google/src/app/unauthorized/unauthorized.component.html: -------------------------------------------------------------------------------- 1 |
401: You have no rights to access this. Please Login
2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-http-config/src/app/unauthorized/unauthorized.component.html: -------------------------------------------------------------------------------- 1 |
401: You have no rights to access this. Please Login
2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4/src/app/unauthorized/unauthorized.component.html: -------------------------------------------------------------------------------- 1 |
401: You have no rights to access this. Please Login
2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Azure-B2C/src/app/unauthorized/unauthorized.component.html: -------------------------------------------------------------------------------- 1 |
401: You have no rights to access this. Please Login
2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-iframe/src/app/unauthorized/unauthorized.component.html: -------------------------------------------------------------------------------- 1 |
401: You have no rights to access this. Please Login
2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-par/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

Sample Code Flow Pushed Authorisation Requests

2 | 3 | 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-refresh-tokens/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

Sample Code Flow with refresh tokens

2 | 3 | 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-refresh-tokens/src/app/unauthorized/unauthorized.component.html: -------------------------------------------------------------------------------- 1 |
401: You have no rights to access this. Please Login
2 | -------------------------------------------------------------------------------- /docs/site/angular-auth-oidc-client/docs/documentation/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Documentation", 3 | "position": 2, 4 | "collapsed": false 5 | } 6 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/login/par/par-response.ts: -------------------------------------------------------------------------------- 1 | export interface ParResponse { 2 | requestUri: string; 3 | expiresIn: number; 4 | } 5 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auth0/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

Auth0 Sample Code Flow PKCE with refresh tokens

2 | 3 | 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-par/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/projects/sample-code-flow-par/src/favicon.ico -------------------------------------------------------------------------------- /projects/sample-implicit-flow-silent-renew/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

Sample Implicit Flow With Silent Renew

2 | 3 | 4 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-silent-renew/src/app/unauthorized/unauthorized.component.html: -------------------------------------------------------------------------------- 1 |
401: You have no rights to access this. Please Login
2 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/login/popup/popup-result.ts: -------------------------------------------------------------------------------- 1 | export interface PopupResult { 2 | userClosed: boolean; 3 | receivedUrl: string; 4 | } 5 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auth0/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/projects/sample-code-flow-auth0/src/favicon.ico -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/unauthorized/unauthorized.component.html: -------------------------------------------------------------------------------- 1 |
401: You have no rights to access this. Please Login
2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/projects/sample-code-flow-azuread/src/favicon.ico -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4-popup/src/app/unauthorized/unauthorized.component.html: -------------------------------------------------------------------------------- 1 |
401: You have no rights to access this. Please Login
2 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-iframe/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

Sample Code Flow multiple clients with iframes

2 | 3 | 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-popup/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/projects/sample-code-flow-popup/src/favicon.ico -------------------------------------------------------------------------------- /.github/angular-auth-oidc-client-schematics-720.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/.github/angular-auth-oidc-client-schematics-720.gif -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/projects/sample-code-flow-azure-b2c/src/favicon.ico -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-AAD/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/projects/sample-code-flow-multi-AAD/src/favicon.ico -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

ID4 with refresh tokens, Auth0 with refresh tokens

2 | 3 | 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/projects/sample-code-flow-auto-login/src/favicon.ico -------------------------------------------------------------------------------- /projects/sample-code-flow-http-config/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/projects/sample-code-flow-http-config/src/favicon.ico -------------------------------------------------------------------------------- /projects/sample-code-flow-lazy-loaded/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/projects/sample-code-flow-lazy-loaded/src/favicon.ico -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-iframe/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/projects/sample-code-flow-multi-iframe/src/favicon.ico -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/projects/sample-code-flow-standalone/src/favicon.ico -------------------------------------------------------------------------------- /projects/sample-implicit-flow-google/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/projects/sample-implicit-flow-google/src/favicon.ico -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/app/forbidden/forbidden.component.html: -------------------------------------------------------------------------------- 1 |
2 | Normally you should not see this, authenticated == {{ isAuthenticated }} 3 |
4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4-popup/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

ID4 with refresh tokens, Auth0 with refresh tokens

2 | 3 | 4 | -------------------------------------------------------------------------------- /projects/sample-code-flow-refresh-tokens/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/projects/sample-code-flow-refresh-tokens/src/favicon.ico -------------------------------------------------------------------------------- /docs/site/angular-auth-oidc-client/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/docs/site/angular-auth-oidc-client/static/img/favicon.ico -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/projects/sample-code-flow-multi-Auth0-ID4/src/favicon.ico -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Azure-B2C/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/projects/sample-code-flow-multi-Azure-B2C/src/favicon.ico -------------------------------------------------------------------------------- /projects/sample-implicit-flow-silent-renew/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/projects/sample-implicit-flow-silent-renew/src/favicon.ico -------------------------------------------------------------------------------- /docs/site/angular-auth-oidc-client/static/img/docusaurus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/docs/site/angular-auth-oidc-client/static/img/docusaurus.png -------------------------------------------------------------------------------- /projects/sample-implicit-flow-google/src/assets/damienbod.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/projects/sample-implicit-flow-google/src/assets/damienbod.jpg -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/login/popup/popup-options.ts: -------------------------------------------------------------------------------- 1 | export interface PopupOptions { 2 | width?: number; 3 | height?: number; 4 | left?: number; 5 | top?: number; 6 | } 7 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/projects/sample-code-flow-auto-login-all-routes/src/favicon.ico -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 |
Welcome
2 | 3 |
4 | Is Authenticated: {{ isAuthenticated }} 5 |
{{ userData$ | async | json }}
6 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 |
Welcome
2 | 3 |
4 | Is Authenticated: {{ isAuthenticated }} 5 |
{{ userData$ | async | json }}
6 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4-popup/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/projects/sample-code-flow-multi-Auth0-ID4-popup/src/favicon.ico -------------------------------------------------------------------------------- /projects/sample-implicit-flow-google/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 |
Welcome
2 | 3 |
4 | Is Authenticated: {{ isAuthenticated }} 5 |
{{ userData$ | async | json }}
6 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/app/forbidden/forbidden.component.html: -------------------------------------------------------------------------------- 1 |
2 | Normally you should not see this, authenticated == 3 | {{ authenticated().isAuthenticated }} 4 |
5 | -------------------------------------------------------------------------------- /docs/site/angular-auth-oidc-client/src/pages/markdown-page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Markdown page example 3 | --- 4 | 5 | # Markdown page example 6 | 7 | You don't need React to write simple standalone pages. 8 | -------------------------------------------------------------------------------- /docs/site/angular-auth-oidc-client/static/img/angular-auth-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/docs/site/angular-auth-oidc-client/static/img/angular-auth-logo.png -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/forbidden/forbidden.component.html: -------------------------------------------------------------------------------- 1 |
2 | Normally you should not see this, authenticated == 3 | {{ isAuthenticated$ | async }} 4 |
5 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 |
Welcome to home Route
2 | 3 |
4 | Is Authenticated: {{ isAuthenticated }} 5 |
{{ userData$ | async | json }}
6 | -------------------------------------------------------------------------------- /docs/site/angular-auth-oidc-client/static/img/tutorial/localeDropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/docs/site/angular-auth-oidc-client/static/img/tutorial/localeDropdown.png -------------------------------------------------------------------------------- /docs/site/angular-auth-oidc-client/docs/migrations/v19-to-v20.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 94 3 | --- 4 | 5 | # Version 19 to 20 6 | 7 | ## TL;DR: Breaking Changes 8 | 9 | - Requires Angular v20 or higher 10 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/public-events/notification.ts: -------------------------------------------------------------------------------- 1 | import { EventTypes } from './event-types'; 2 | 3 | export interface OidcClientNotification { 4 | type: EventTypes; 5 | value?: T; 6 | } 7 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 |
Welcome to home Route
2 | 3 |
4 | Is Authenticated: {{ isAuthenticated }} 5 |
{{ userData$ | async | json }}
6 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 |
Welcome to home Route
2 | 3 |
4 | Is Authenticated: {{ authenticated().isAuthenticated }} 5 |
{{ userData() | json }}
6 | -------------------------------------------------------------------------------- /docs/site/angular-auth-oidc-client/static/img/tutorial/docsVersionDropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/angular-auth-oidc-client/HEAD/docs/site/angular-auth-oidc-client/static/img/tutorial/docsVersionDropdown.png -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/refactoring.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Code refactoring 3 | about: Any code improvements which make the code better 4 | title: '[Refactoring]: ' 5 | assignees: 'FabianGosebrink' 6 | labels: ['refactoring'] 7 | --- 8 | -------------------------------------------------------------------------------- /docs/site/angular-auth-oidc-client/docs/migrations/v12-to-v13.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 98 3 | --- 4 | 5 | # Version 12 to 13 6 | 7 | ## Update to RxJS 7 8 | 9 | Update nodejs. This version is now using rxjs 7 10 | -------------------------------------------------------------------------------- /docs/site/angular-auth-oidc-client/docs/migrations/v16-to-v17.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 94 3 | --- 4 | 5 | # Version 16 to 17 6 | 7 | ## TL;DR: Breaking Changes 8 | 9 | - There should be no breaking changes in this version. 10 | -------------------------------------------------------------------------------- /projects/schematics/src/ng-add/files/auth-config-standalone/auth.config.__ts__: -------------------------------------------------------------------------------- 1 | import { PassedInitialConfig } from 'angular-auth-oidc-client'; 2 | 3 | export const authConfig: PassedInitialConfig = { 4 | config: <%= authConfig %> 5 | } 6 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | @media (max-width: 767px) { 2 | /* On small screens, the nav menu spans the full width of the screen. Leave a space for it. */ 3 | .body-content { 4 | padding-top: 50px; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | @media (max-width: 767px) { 2 | /* On small screens, the nav menu spans the full width of the screen. Leave a space for it. */ 3 | .body-content { 4 | padding-top: 50px; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/flows/flows.models.ts: -------------------------------------------------------------------------------- 1 | export interface SilentRenewRunning { 2 | state: SilentRenewRunningState; 3 | dateOfLaunchedProcessUtc: string; 4 | } 5 | 6 | export type SilentRenewRunningState = 'running' | 'not-running'; 7 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/login/login-response.ts: -------------------------------------------------------------------------------- 1 | export interface LoginResponse { 2 | isAuthenticated: boolean; 3 | userData: any; 4 | accessToken: string; 5 | idToken: string; 6 | configId?: string; 7 | errorMessage?: string; 8 | } 9 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: 'app.component.html', 6 | standalone: false 7 | }) 8 | export class AppComponent {} 9 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-google/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 0; 3 | } 4 | 5 | .starter-template { 6 | padding: 40px 15px; 7 | text-align: center; 8 | } 9 | 10 | .navigationLinkButton:hover { 11 | cursor: pointer; 12 | } 13 | -------------------------------------------------------------------------------- /projects/sample-code-flow-lazy-loaded/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | Lazy loaded module | 2 | To root 3 | 4 |

Free stuff where the user does not have to authenticate

5 | 6 | 7 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/user-data/userdata-result.ts: -------------------------------------------------------------------------------- 1 | export interface UserDataResult { 2 | userData: any; 3 | allUserData: ConfigUserDataResult[]; 4 | } 5 | 6 | export interface ConfigUserDataResult { 7 | configId: string; 8 | userData: any; 9 | } 10 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 |
6 | 7 |
8 |
9 |
10 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/utils/collections/collections.helper.ts: -------------------------------------------------------------------------------- 1 | export function flattenArray(array: any[][]): any[] { 2 | return array.reduce( 3 | (flattened, elem) => 4 | flattened.concat(Array.isArray(elem) ? flattenArray(elem) : elem), 5 | [] 6 | ); 7 | } 8 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 |
6 | 7 |
8 |
9 |
10 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 |
6 | 7 |
8 |
9 |
10 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 |
6 | 7 |
8 |
9 |
10 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-google/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 |
6 | 7 |
8 |
9 |
10 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-google/src/app/forbidden/forbidden.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-forbidden', 5 | templateUrl: 'forbidden.component.html', 6 | standalone: false 7 | }) 8 | export class ForbiddenComponent {} 9 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/validation/jwtkeys.ts: -------------------------------------------------------------------------------- 1 | export interface JwtKeys { 2 | keys: JwtKey[]; 3 | } 4 | 5 | export interface JwtKey { 6 | kty: string; 7 | use: string; 8 | kid: string; 9 | x5t: string; 10 | e: string; 11 | n: string; 12 | x5c: any[]; 13 | } 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auth0/src/app/unauthorized/unauthorized.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-unauthorized', 5 | templateUrl: 'unauthorized.component.html', 6 | standalone: false 7 | }) 8 | export class UnauthorizedComponent {} 9 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 |
6 | 7 |
8 |
9 |
10 | -------------------------------------------------------------------------------- /projects/sample-code-flow-par/src/app/unauthorized/unauthorized.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-unauthorized', 5 | templateUrl: 'unauthorized.component.html', 6 | standalone: false 7 | }) 8 | export class UnauthorizedComponent {} 9 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/app/unauthorized/unauthorized.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-unauthorized', 5 | templateUrl: 'unauthorized.component.html', 6 | standalone: true, 7 | }) 8 | export class UnauthorizedComponent {} 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question 3 | about: Ask a question using this lib like 'How can I ...' 4 | title: '[Question]: ' 5 | labels: ['question'] 6 | assignees: '' 7 | --- 8 | 9 | **What Version of the library are you using?** 10 | ... 11 | 12 | **Question** 13 | How can I ... 14 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/auth-state/auth-state.ts: -------------------------------------------------------------------------------- 1 | import { ValidationResult } from '../validation/validation-result'; 2 | 3 | export interface AuthStateResult { 4 | isAuthenticated: boolean; 5 | validationResult: ValidationResult; 6 | isRenewProcess: boolean; 7 | configId?: string; 8 | } 9 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/app/unauthorized/unauthorized.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-unauthorized', 5 | templateUrl: 'unauthorized.component.html', 6 | standalone: false 7 | }) 8 | export class UnauthorizedComponent {} 9 | -------------------------------------------------------------------------------- /projects/sample-code-flow-http-config/src/app/unauthorized/unauthorized.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-unauthorized', 5 | templateUrl: 'unauthorized.component.html', 6 | standalone: false 7 | }) 8 | export class UnauthorizedComponent {} 9 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-AAD/src/app/unauthorized/unauthorized.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-unauthorized', 5 | templateUrl: 'unauthorized.component.html', 6 | standalone: false 7 | }) 8 | export class UnauthorizedComponent {} 9 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-google/src/app/unauthorized/unauthorized.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-unauthorized', 5 | templateUrl: 'unauthorized.component.html', 6 | standalone: false 7 | }) 8 | export class UnauthorizedComponent {} 9 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4/src/app/unauthorized/unauthorized.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-unauthorized', 5 | templateUrl: 'unauthorized.component.html', 6 | standalone: false 7 | }) 8 | export class UnauthorizedComponent {} 9 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Azure-B2C/src/app/unauthorized/unauthorized.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-unauthorized', 5 | templateUrl: 'unauthorized.component.html', 6 | standalone: false 7 | }) 8 | export class UnauthorizedComponent {} 9 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-iframe/src/app/unauthorized/unauthorized.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-unauthorized', 5 | templateUrl: 'unauthorized.component.html', 6 | standalone: false 7 | }) 8 | export class UnauthorizedComponent {} 9 | -------------------------------------------------------------------------------- /projects/sample-code-flow-refresh-tokens/src/app/unauthorized/unauthorized.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-unauthorized', 5 | templateUrl: 'unauthorized.component.html', 6 | standalone: false 7 | }) 8 | export class UnauthorizedComponent {} 9 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-silent-renew/src/app/unauthorized/unauthorized.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-unauthorized', 5 | templateUrl: 'unauthorized.component.html', 6 | standalone: false 7 | }) 8 | export class UnauthorizedComponent {} 9 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/unauthorized/unauthorized.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-unauthorized', 5 | templateUrl: 'unauthorized.component.html', 6 | standalone: false 7 | }) 8 | export class UnauthorizedComponent {} 9 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4-popup/src/app/unauthorized/unauthorized.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-unauthorized', 5 | templateUrl: 'unauthorized.component.html', 6 | standalone: false 7 | }) 8 | export class UnauthorizedComponent {} 9 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/auth-state/auth-result.ts: -------------------------------------------------------------------------------- 1 | export interface AuthenticatedResult { 2 | isAuthenticated: boolean; 3 | allConfigsAuthenticated: ConfigAuthenticatedResult[]; 4 | } 5 | 6 | export interface ConfigAuthenticatedResult { 7 | configId: string; 8 | isAuthenticated: boolean; 9 | } 10 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/app/customers/customers.routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | import { CustomersComponent } from './customers.component'; 3 | 4 | export const routes: Routes = [ 5 | { path: '', component: CustomersComponent }, 6 | { path: 'details', component: CustomersComponent }, 7 | ]; 8 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/tsconfig.lib.prod.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.lib.json", 4 | "compilerOptions": { 5 | "declarationMap": false 6 | }, 7 | "angularCompilerOptions": { 8 | "compilationMode": "partial" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/utils/object/object.helper.ts: -------------------------------------------------------------------------------- 1 | export function removeNullAndUndefinedValues(obj: any): any { 2 | const copy = { ...obj }; 3 | 4 | for (const key in obj) { 5 | if (obj[key] === undefined || obj[key] === null) { 6 | delete copy[key]; 7 | } 8 | } 9 | 10 | return copy; 11 | } 12 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/src/app/forbidden/forbidden.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-forbidden', 5 | templateUrl: './forbidden.component.html', 6 | styleUrls: ['./forbidden.component.css'], 7 | standalone: true, 8 | }) 9 | export class ForbiddenComponent {} 10 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/src/app/protected/protected.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-protected', 5 | templateUrl: './protected.component.html', 6 | styleUrls: ['./protected.component.css'], 7 | standalone: true, 8 | }) 9 | export class ProtectedComponent {} 10 | -------------------------------------------------------------------------------- /projects/sample-code-flow-popup/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | const routes: Routes = []; 5 | 6 | @NgModule({ 7 | imports: [RouterModule.forRoot(routes)], 8 | exports: [RouterModule], 9 | }) 10 | export class AppRoutingModule {} 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/app/customers/customers.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-customers', 5 | templateUrl: './customers.component.html', 6 | styleUrls: ['./customers.component.css'], 7 | standalone: true, 8 | }) 9 | export class CustomersComponent {} 10 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/app/protected/protected.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-protected', 5 | templateUrl: './protected.component.html', 6 | styleUrls: ['./protected.component.css'], 7 | standalone: true, 8 | }) 9 | export class ProtectedComponent {} 10 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/src/app/forbidden/forbidden.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-forbidden', 5 | templateUrl: './forbidden.component.html', 6 | styleUrls: ['./forbidden.component.css'], 7 | standalone: false 8 | }) 9 | export class ForbiddenComponent {} 10 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/src/app/protected/protected.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-protected', 5 | templateUrl: './protected.component.html', 6 | styleUrls: ['./protected.component.css'], 7 | standalone: false 8 | }) 9 | export class ProtectedComponent {} 10 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": ["src/main.ts"], 9 | "include": ["src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/app/customers/customers.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-customers', 5 | templateUrl: './customers.component.html', 6 | styleUrls: ['./customers.component.css'], 7 | standalone: false 8 | }) 9 | export class CustomersComponent {} 10 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/app/protected/protected.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-protected', 5 | templateUrl: './protected.component.html', 6 | styleUrls: ['./protected.component.css'], 7 | standalone: false 8 | }) 9 | export class ProtectedComponent {} 10 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/src/app/unauthorized/unauthorized.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-unauthorized', 5 | templateUrl: './unauthorized.component.html', 6 | styleUrls: ['./unauthorized.component.css'], 7 | standalone: true, 8 | }) 9 | export class UnauthorizedComponent {} 10 | -------------------------------------------------------------------------------- /projects/sample-code-flow-par/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": ["src/main.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auth0/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": ["src/main.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/customers/customers.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-customers', 5 | templateUrl: './customers.component.html', 6 | styleUrls: ['./customers.component.css'], 7 | standalone: false 8 | }) 9 | export class CustomersComponent {} 10 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/protected/protected.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-protected', 5 | templateUrl: './protected.component.html', 6 | styleUrls: ['./protected.component.css'], 7 | standalone: false 8 | }) 9 | export class ProtectedComponent {} 10 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": ["src/main.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-popup/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": ["src/main.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /docs/site/angular-auth-oidc-client/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | -------------------------------------------------------------------------------- /docs/site/angular-auth-oidc-client/src/pages/index.js: -------------------------------------------------------------------------------- 1 | import { Redirect } from '@docusaurus/router'; 2 | import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; 3 | import React from 'react'; 4 | 5 | export default function Home() { 6 | const { siteConfig } = useDocusaurusContext(); 7 | return ; 8 | } 9 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": ["src/main.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/src/app/unauthorized/unauthorized.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-unauthorized', 5 | templateUrl: './unauthorized.component.html', 6 | styleUrls: ['./unauthorized.component.css'], 7 | standalone: false 8 | }) 9 | export class UnauthorizedComponent {} 10 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": ["src/main.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-http-config/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": ["src/main.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-lazy-loaded/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": ["src/main.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-AAD/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": ["src/main.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-iframe/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": ["src/main.ts", "src/polyfills.ts"], 9 | "exclude": ["**/*.spec.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-google/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": ["src/main.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/schematics/src/collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json", 3 | "schematics": { 4 | "ng-add": { 5 | "description": "Add angular-auth-oidc-client library to the project.", 6 | "factory": "./ng-add/index#ngAdd", 7 | "schema": "./ng-add/schema.json" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": ["jasmine", "node"] 7 | }, 8 | "files": ["src/test.ts"], 9 | "include": ["**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": ["src/main.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Azure-B2C/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": ["src/main.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-refresh-tokens/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": ["src/main.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-silent-renew/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": ["src/main.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": ["src/main.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4-popup/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": ["src/main.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/schematics/src/ng-add/files/auth-config-module/auth-config.module.__ts__: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { AuthModule } from 'angular-auth-oidc-client'; 3 | 4 | 5 | @NgModule({ 6 | imports: [AuthModule.forRoot({ 7 | config: <%= authConfig %> 8 | })], 9 | exports: [AuthModule], 10 | }) 11 | export class AuthConfigModule {} 12 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/utils/redirect/redirect.service.ts: -------------------------------------------------------------------------------- 1 | 2 | import { Injectable, inject, DOCUMENT } from '@angular/core'; 3 | 4 | @Injectable({ providedIn: 'root' }) 5 | export class RedirectService { 6 | private readonly document = inject(DOCUMENT); 7 | 8 | redirectTo(url: string): void { 9 | this.document.location.href = url; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": ["jasmine", "node"] 7 | }, 8 | "files": ["src/test.ts"], 9 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/integration-tests/test-idp-server/restart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Test IDP Server Restart Script 4 | 5 | SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 6 | 7 | echo "Restarting Test IDP Server..." 8 | 9 | # Stop the server if running 10 | "$SCRIPT_DIR/stop.sh" 11 | 12 | # Wait a moment for cleanup 13 | sleep 2 14 | 15 | # Start the server 16 | "$SCRIPT_DIR/start.sh" -------------------------------------------------------------------------------- /projects/sample-code-flow-auth0/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": ["jasmine"] 7 | }, 8 | "files": ["src/test.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-popup/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": ["jasmine"] 7 | }, 8 | "files": ["src/test.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-par/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": ["jasmine", "node"] 7 | }, 8 | "files": ["src/test.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": ["jasmine", "node"] 7 | }, 8 | "files": ["src/test.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": ["jasmine", "node"] 7 | }, 8 | "files": ["src/test.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-AAD/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": ["jasmine", "node"] 7 | }, 8 | "files": ["src/test.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": ["jasmine"] 7 | }, 8 | "files": ["src/test.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": ["jasmine", "node"] 7 | }, 8 | "files": ["src/test.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-http-config/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": ["jasmine", "node"] 7 | }, 8 | "files": ["src/test.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-lazy-loaded/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": ["jasmine", "node"] 7 | }, 8 | "files": ["src/test.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-iframe/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": ["jasmine", "node"] 7 | }, 8 | "files": ["src/test.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-refresh-tokens/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": ["jasmine", "node"] 7 | }, 8 | "files": ["src/test.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/main.ts: -------------------------------------------------------------------------------- 1 | import { provideZoneChangeDetection } from "@angular/core"; 2 | import { bootstrapApplication } from '@angular/platform-browser'; 3 | 4 | import { AppComponent } from './app/app.component'; 5 | import { appConfig } from './app/app.config'; 6 | 7 | bootstrapApplication(AppComponent, {...appConfig, providers: [provideZoneChangeDetection(), ...appConfig.providers]}); 8 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-google/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": ["jasmine", "node"] 7 | }, 8 | "files": ["src/test.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": ["jasmine", "node"] 7 | }, 8 | "files": ["src/test.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Azure-B2C/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": ["jasmine", "node"] 7 | }, 8 | "files": ["src/test.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-silent-renew/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": ["jasmine", "node"] 7 | }, 8 | "files": ["src/test.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/ng-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", 3 | "dest": "../../dist/angular-auth-oidc-client", 4 | "lib": { 5 | "entryFile": "src/public-api.ts" 6 | }, 7 | "allowedNonPeerDependencies": [ 8 | "rfc4648", 9 | "@angular-devkit/core", 10 | "@schematics/angular", 11 | "@angular-devkit/schematics" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-lazy-loaded/src/app/lazy/lazy.component.html: -------------------------------------------------------------------------------- 1 |

lazy works! Inside the lazy loaded module the user can authenticate

2 | 3 | user is authenticated: {{ isAuthenticated }} 4 | 5 |
6 | 7 |
8 | 9 | @if (isAuthenticated) { 10 |
11 | 12 |
13 | } 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4-popup/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": ["jasmine", "node"] 7 | }, 8 | "files": ["src/test.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-lazy-loaded/src/app/lazy/lazy.module.ts: -------------------------------------------------------------------------------- 1 | import { CommonModule } from '@angular/common'; 2 | import { NgModule } from '@angular/core'; 3 | import { LazyRoutingModule } from './lazy-routing.module'; 4 | import { LazyComponent } from './lazy.component'; 5 | 6 | @NgModule({ 7 | declarations: [LazyComponent], 8 | imports: [CommonModule, LazyRoutingModule], 9 | }) 10 | export class LazyModule {} 11 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/callback/callback.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-callback', 5 | templateUrl: './callback.component.html', 6 | styleUrls: ['./callback.component.css'], 7 | standalone: false 8 | }) 9 | export class CallbackComponent { 10 | ngOnInit(): void { 11 | // Maybe some business logic 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-popup/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SampleCodeFlowPopup 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auth0/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Auth0 Sample Code Flow PKCE 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-iframe/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Sample Code Flow 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-lazy-loaded/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SampleCodeFlowLazyLoaded 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-AAD/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Multiple Azure AD clients 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /projects/schematics/src/ng-add/index.ts: -------------------------------------------------------------------------------- 1 | import { chain, Rule, SchematicContext, Tree } from '@angular-devkit/schematics'; 2 | import { getAllActions } from './actions'; 3 | import { Schema } from './schema'; 4 | 5 | export function ngAdd(options: Schema): Rule { 6 | return async (host: Tree, context: SchematicContext) => { 7 | const allActions = await getAllActions(host, options); 8 | return chain(allActions); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/lib", 6 | "declaration": true, 7 | "declarationMap": true, 8 | "inlineSources": true, 9 | "types": [ 10 | "node" 11 | ] 12 | }, 13 | "exclude": ["src/test.ts", "**/*.spec.ts"] 14 | } 15 | -------------------------------------------------------------------------------- /projects/sample-code-flow-http-config/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Sample Code Flow HttpConfig 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Auth0 & ID4 multi clients 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Azure-B2C/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Multiple Azure AD clients 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4-popup/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Auth0 & ID4 multi clients 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-refresh-tokens/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Sample Code Flow Refresh Tokens 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/utils/platform-provider/platform.provider.ts: -------------------------------------------------------------------------------- 1 | import { isPlatformBrowser } from '@angular/common'; 2 | import { Injectable, PLATFORM_ID, inject } from '@angular/core'; 3 | 4 | @Injectable({ providedIn: 'root' }) 5 | export class PlatformProvider { 6 | private readonly platformId = inject(PLATFORM_ID); 7 | 8 | isBrowser(): boolean { 9 | return isPlatformBrowser(this.platformId); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /projects/sample-code-flow-lazy-loaded/src/app/lazy/lazy-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | import { LazyComponent } from './lazy.component'; 5 | 6 | const routes: Routes = [{ path: '', component: LazyComponent }]; 7 | 8 | @NgModule({ 9 | imports: [RouterModule.forChild(routes)], 10 | exports: [RouterModule], 11 | }) 12 | export class LazyRoutingModule {} 13 | -------------------------------------------------------------------------------- /projects/sample-code-flow-par/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Sample Code Flow Pushed Authorisation Requests 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-silent-renew/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Sample Implicit Flow Silent Renew 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/config/auth-well-known/auth-well-known-endpoints.ts: -------------------------------------------------------------------------------- 1 | export interface AuthWellKnownEndpoints { 2 | issuer?: string; 3 | jwksUri?: string; 4 | authorizationEndpoint?: string; 5 | tokenEndpoint?: string; 6 | userInfoEndpoint?: string; 7 | endSessionEndpoint?: string; 8 | checkSessionIframe?: string; 9 | revocationEndpoint?: string; 10 | introspectionEndpoint?: string; 11 | parEndpoint?: string; 12 | } 13 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/src/main.ts: -------------------------------------------------------------------------------- 1 | import { provideZoneChangeDetection } from "@angular/core"; 2 | import { bootstrapApplication } from '@angular/platform-browser'; 3 | 4 | import { AppComponent } from './app/app.component'; 5 | import { appConfig } from './app/app.config'; 6 | 7 | bootstrapApplication(AppComponent, {...appConfig, providers: [provideZoneChangeDetection(), ...appConfig.providers]}).catch((err) => 8 | console.error(err) 9 | ); 10 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/validation/state-validation-result.ts: -------------------------------------------------------------------------------- 1 | import { ValidationResult } from './validation-result'; 2 | 3 | export class StateValidationResult { 4 | constructor( 5 | public accessToken = '', 6 | public idToken = '', 7 | public authResponseIsValid = false, 8 | public decodedIdToken: any = { 9 | at_hash: '', 10 | }, 11 | public state: ValidationResult = ValidationResult.NotSet 12 | ) {} 13 | } 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/forbidden/forbidden.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, inject } from '@angular/core'; 2 | import { OidcSecurityService } from 'angular-auth-oidc-client'; 3 | 4 | @Component({ 5 | selector: 'app-forbidden', 6 | templateUrl: 'forbidden.component.html', 7 | standalone: false 8 | }) 9 | export class ForbiddenComponent { 10 | public isAuthenticated$ = inject(OidcSecurityService).isAuthenticated$; 11 | } 12 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/app/customers/customers.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | import { CustomersRoutingModule } from './customers-routing.module'; 5 | import { CustomersComponent } from './customers.component'; 6 | 7 | @NgModule({ 8 | declarations: [CustomersComponent], 9 | imports: [CommonModule, CustomersRoutingModule], 10 | }) 11 | export class CustomersModule {} 12 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/auth-options.ts: -------------------------------------------------------------------------------- 1 | export interface AuthOptions { 2 | customParams?: { [key: string]: string | number | boolean }; 3 | urlHandler?(url: string): void; 4 | /** overrides redirectUrl from configuration */ 5 | redirectUrl?: string; 6 | } 7 | 8 | export interface LogoutAuthOptions { 9 | customParams?: { [key: string]: string | number | boolean }; 10 | urlHandler?(url: string): void; 11 | logoffMethod?: 'GET' | 'POST'; 12 | } 13 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Use this section to tell people about which versions of your project are 6 | currently being supported with security updates. 7 | 8 | | Version | Supported | 9 | | ------- | ------------------ | 10 | | 13.x | :white_check_mark: | 11 | | 12.x | :white_check_mark: | 12 | | < 12 | :x: | 13 | 14 | ## Reporting a Vulnerability 15 | 16 | Please report here: angular-oidc@outlook.com 17 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/customers/customers.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | import { CustomersRoutingModule } from './customers-routing.module'; 5 | import { CustomersComponent } from './customers.component'; 6 | 7 | @NgModule({ 8 | declarations: [CustomersComponent], 9 | imports: [CommonModule, CustomersRoutingModule], 10 | }) 11 | export class CustomersModule {} 12 | -------------------------------------------------------------------------------- /projects/sample-code-flow-lazy-loaded/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | 4 | const routes: Routes = [ 5 | { 6 | path: 'lazy', 7 | loadChildren: () => import('./lazy/lazy.module').then((m) => m.LazyModule), 8 | }, 9 | ]; 10 | 11 | @NgModule({ 12 | imports: [RouterModule.forRoot(routes)], 13 | exports: [RouterModule], 14 | }) 15 | export class AppRoutingModule {} 16 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/public-events/event-types.ts: -------------------------------------------------------------------------------- 1 | export enum EventTypes { 2 | /** 3 | * This only works in the AppModule Constructor 4 | */ 5 | ConfigLoaded, 6 | CheckingAuth, 7 | CheckingAuthFinished, 8 | CheckingAuthFinishedWithError, 9 | ConfigLoadingFailed, 10 | CheckSessionReceived, 11 | UserDataChanged, 12 | NewAuthenticationResult, 13 | TokenExpired, 14 | IdTokenExpired, 15 | SilentRenewStarted, 16 | SilentRenewFailed, 17 | } 18 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/utils/crypto/crypto.service.ts: -------------------------------------------------------------------------------- 1 | 2 | import { Injectable, inject, DOCUMENT } from '@angular/core'; 3 | 4 | @Injectable({ providedIn: 'root' }) 5 | export class CryptoService { 6 | private readonly document = inject(DOCUMENT); 7 | 8 | getCrypto(): any { 9 | // support for IE, (window.crypto || window.msCrypto) 10 | return ( 11 | this.document.defaultView?.crypto || 12 | (this.document.defaultView as any)?.msCrypto 13 | ); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/app/forbidden/forbidden.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, inject } from '@angular/core'; 2 | import { OidcSecurityService } from 'angular-auth-oidc-client'; 3 | 4 | @Component({ 5 | selector: 'app-forbidden', 6 | templateUrl: 'forbidden.component.html', 7 | standalone: true, 8 | }) 9 | export class ForbiddenComponent { 10 | private readonly oidcSecurityService = inject(OidcSecurityService); 11 | protected readonly authenticated = this.oidcSecurityService.authenticated; 12 | } 13 | -------------------------------------------------------------------------------- /projects/integration-tests/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ 2 | /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ 3 | { 4 | "extends": "../../tsconfig.json", 5 | "compilerOptions": { 6 | "outDir": "../../out-tsc/app", 7 | "types": [] 8 | }, 9 | "files": [ 10 | "src/main.ts" 11 | ], 12 | "include": [ 13 | "src/**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /projects/schematics/src/ng-add/actions/install-dependencies.ts: -------------------------------------------------------------------------------- 1 | import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics'; 2 | import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks'; 3 | 4 | export function installPackageJsonDependencies(): Rule { 5 | return (host: Tree, context: SchematicContext) => { 6 | context.logger.info(`🔍 Installing packages...`); 7 | context.addTask(new NodePackageInstallTask()); 8 | context.logger.info(`✅️ Installed`); 9 | 10 | return host; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/logging/abstract-logger.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | /** 4 | * Implement this class-interface to create a custom logger service. 5 | */ 6 | @Injectable({ providedIn: 'root' }) 7 | export abstract class AbstractLoggerService { 8 | abstract logError(message: string | object, ...args: any[]): void; 9 | 10 | abstract logWarning(message: string | object, ...args: any[]): void; 11 | 12 | abstract logDebug(message: string | object, ...args: any[]): void; 13 | } 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/app/customers/customers-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | import { CustomersComponent } from './customers.component'; 4 | 5 | const routes: Routes = [ 6 | { path: '', component: CustomersComponent }, 7 | { path: 'details', component: CustomersComponent }, 8 | ]; 9 | 10 | @NgModule({ 11 | imports: [RouterModule.forChild(routes)], 12 | exports: [RouterModule], 13 | }) 14 | export class CustomersRoutingModule {} 15 | -------------------------------------------------------------------------------- /projects/sample-code-flow-popup/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { AppRoutingModule } from './app-routing.module'; 4 | import { AppComponent } from './app.component'; 5 | import { AuthConfigModule } from './auth-config.module'; 6 | 7 | @NgModule({ 8 | declarations: [AppComponent], 9 | imports: [BrowserModule, AppRoutingModule, AuthConfigModule], 10 | providers: [], 11 | bootstrap: [AppComponent], 12 | }) 13 | export class AppModule {} 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auth0/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic() 12 | .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()], }) 13 | .catch((err) => console.error(err)); 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-par/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic() 12 | .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()], }) 13 | .catch((err) => console.error(err)); 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-popup/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic() 12 | .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()], }) 13 | .catch((err) => console.error(err)); 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/customers/customers-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | import { CustomersComponent } from './customers.component'; 4 | 5 | const routes: Routes = [ 6 | { path: '', component: CustomersComponent }, 7 | { path: 'details', component: CustomersComponent }, 8 | ]; 9 | 10 | @NgModule({ 11 | imports: [RouterModule.forChild(routes)], 12 | exports: [RouterModule], 13 | }) 14 | export class CustomersRoutingModule {} 15 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic() 12 | .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()], }) 13 | .catch((err) => console.error(err)); 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic() 12 | .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()], }) 13 | .catch((err) => console.error(err)); 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-AAD/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic() 12 | .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()], }) 13 | .catch((err) => console.error(err)); 14 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-google/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic() 12 | .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()], }) 13 | .catch((err) => console.error(err)); 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-http-config/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic() 12 | .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()], }) 13 | .catch((err) => console.error(err)); 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-lazy-loaded/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic() 12 | .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()], }) 13 | .catch((err) => console.error(err)); 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic() 12 | .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()], }) 13 | .catch((err) => console.error(err)); 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Azure-B2C/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic() 12 | .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()], }) 13 | .catch((err) => console.error(err)); 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-iframe/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic() 12 | .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()], }) 13 | .catch((err) => console.error(err)); 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-refresh-tokens/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic() 12 | .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()], }) 13 | .catch((err) => console.error(err)); 14 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/auth-config.spec.ts: -------------------------------------------------------------------------------- 1 | import { PassedInitialConfig, createStaticLoader } from './auth-config'; 2 | 3 | describe('AuthConfig', () => { 4 | describe('createStaticLoader', () => { 5 | it('should throw an error if no config is provided', () => { 6 | // Arrange 7 | const passedConfig = {} as PassedInitialConfig; 8 | 9 | // Act 10 | 11 | // Assert 12 | expect(() => createStaticLoader(passedConfig)).toThrowError( 13 | 'No config provided!' 14 | ); 15 | }); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-silent-renew/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic() 12 | .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()], }) 13 | .catch((err) => console.error(err)); 14 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/config/validation/rule.ts: -------------------------------------------------------------------------------- 1 | import { OpenIdConfiguration } from '../openid-configuration'; 2 | 3 | export interface Rule { 4 | validate(passedConfig: OpenIdConfiguration): RuleValidationResult; 5 | } 6 | 7 | export interface RuleValidationResult { 8 | result: boolean; 9 | messages: string[]; 10 | level: Level; 11 | } 12 | 13 | export const POSITIVE_VALIDATION_RESULT: RuleValidationResult = { 14 | result: true, 15 | messages: [], 16 | level: 'none', 17 | }; 18 | 19 | export type Level = 'warning' | 'error' | 'none'; 20 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic() 12 | .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()], }) 13 | .catch((err) => console.error(err)); 14 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4-popup/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic() 12 | .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()], }) 13 | .catch((err) => console.error(err)); 14 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/utils/url/uri-encoder.ts: -------------------------------------------------------------------------------- 1 | import { HttpParameterCodec } from '@angular/common/http'; 2 | 3 | export class UriEncoder implements HttpParameterCodec { 4 | encodeKey(key: string): string { 5 | return encodeURIComponent(key); 6 | } 7 | 8 | encodeValue(value: string): string { 9 | return encodeURIComponent(value); 10 | } 11 | 12 | decodeKey(key: string): string { 13 | return decodeURIComponent(key); 14 | } 15 | 16 | decodeValue(value: string): string { 17 | return decodeURIComponent(value); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /docs/site/angular-auth-oidc-client/src/pages/index.module.css: -------------------------------------------------------------------------------- 1 | /* stylelint-disable docusaurus/copyright-header */ 2 | 3 | /** 4 | * CSS files with the .module.css suffix will be treated as CSS modules 5 | * and scoped locally. 6 | */ 7 | 8 | .heroBanner { 9 | padding: 4rem 0; 10 | text-align: center; 11 | position: relative; 12 | overflow: hidden; 13 | } 14 | 15 | @media screen and (max-width: 966px) { 16 | .heroBanner { 17 | padding: 2rem; 18 | } 19 | } 20 | 21 | .buttons { 22 | display: flex; 23 | align-items: center; 24 | justify-content: center; 25 | } 26 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/utils/regex/regex.helper.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Creates a RegExp from the given string, converting asterisks to .* expressions, 3 | * and escaping all other characters. 4 | */ 5 | export function wildcardToRegExp(value: string): RegExp { 6 | const regexPattern = regExpEscape(value); 7 | 8 | return new RegExp(`^${regexPattern}$`); 9 | } 10 | 11 | /** 12 | * RegExp-escapes all characters in the given string. 13 | */ 14 | function regExpEscape(value: string): string { 15 | return value.replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*'); 16 | } 17 | -------------------------------------------------------------------------------- /certs/Readme.md: -------------------------------------------------------------------------------- 1 | # Installing Development Certificates 2 | 3 | > [!IMPORTANT] 4 | > The certificate in this folder is for illustrative purposes only. Please use your own certificate. 5 | 6 | 1. Double-click the `pfx` on a Windows machine and use the password `1234` to install. 7 | 1. Add the certificates to the Angular CLI project, for example in the **/certs** folder. 8 | 1. Update the `ui\angular.json` file to point to the certificate files: 9 | 10 | ```json 11 | "sslKey": "certs/dev_localhost.key", 12 | "sslCert": "certs/dev_localhost.pem", 13 | "port": 4201 14 | ``` 15 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/config/validation/rules/ensure-clientId.rule.ts: -------------------------------------------------------------------------------- 1 | import { OpenIdConfiguration } from '../../openid-configuration'; 2 | import { POSITIVE_VALIDATION_RESULT, RuleValidationResult } from '../rule'; 3 | 4 | export const ensureClientId = ( 5 | passedConfig: OpenIdConfiguration 6 | ): RuleValidationResult => { 7 | if (!passedConfig.clientId) { 8 | return { 9 | result: false, 10 | messages: ['The clientId is required and missing from your config!'], 11 | level: 'error', 12 | }; 13 | } 14 | 15 | return POSITIVE_VALIDATION_RESULT; 16 | }; 17 | -------------------------------------------------------------------------------- /projects/integration-tests/test-idp-server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "module": "commonjs", 5 | "lib": ["ES2020"], 6 | "outDir": "./dist", 7 | "rootDir": "./src", 8 | "strict": true, 9 | "esModuleInterop": true, 10 | "skipLibCheck": true, 11 | "forceConsistentCasingInFileNames": true, 12 | "resolveJsonModule": true, 13 | "moduleResolution": "node", 14 | "declaration": true, 15 | "declarationMap": true, 16 | "sourceMap": true 17 | }, 18 | "include": ["src/**/*"], 19 | "exclude": ["node_modules", "dist"] 20 | } -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-AAD/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 |
Welcome to home Route
2 | 3 |
4 | UserData 5 |
{{ userData$ | async | json }}
6 | 7 | @for (config of configurations; track config) { 8 |
9 |

{{ config.configId }}

10 | 13 | 14 | 15 |
{{ config | json }}
16 |
17 | } 18 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-iframe/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 |
Welcome to home Route
2 | 3 | Is Authenticated: 4 |
{{ isAuthenticated$ | async | json }}
5 | 6 |
7 | UserData 8 |
{{ userData$ | async | json }}
9 | 10 | @for (config of configurations; track config) { 11 |
12 |

{{ config.configId }}

13 | 16 | 17 |
{{ config | json }}
18 |
19 | } 20 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/config/validation/rules/ensure-authority.rule.ts: -------------------------------------------------------------------------------- 1 | import { OpenIdConfiguration } from '../../openid-configuration'; 2 | import { POSITIVE_VALIDATION_RESULT, RuleValidationResult } from '../rule'; 3 | 4 | export const ensureAuthority = ( 5 | passedConfig: OpenIdConfiguration 6 | ): RuleValidationResult => { 7 | if (!passedConfig.authority) { 8 | return { 9 | result: false, 10 | messages: ['The authority URL MUST be provided in the configuration! '], 11 | level: 'error', 12 | }; 13 | } 14 | 15 | return POSITIVE_VALIDATION_RESULT; 16 | }; 17 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Azure-B2C/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 |
Welcome to home Route
2 | 3 |
4 | UserData 5 |
{{ userData$ | async | json }}
6 | 7 | @for (config of configurations; track config) { 8 |
9 |

{{ config.configId }}

10 | 13 | 14 | 15 |
{{ config | json }}
16 |
17 | } 18 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/config/validation/rules/ensure-redirect-url.rule.ts: -------------------------------------------------------------------------------- 1 | import { OpenIdConfiguration } from '../../openid-configuration'; 2 | import { POSITIVE_VALIDATION_RESULT, RuleValidationResult } from '../rule'; 3 | 4 | export const ensureRedirectRule = ( 5 | passedConfig: OpenIdConfiguration 6 | ): RuleValidationResult => { 7 | if (!passedConfig.redirectUrl) { 8 | return { 9 | result: false, 10 | messages: ['The redirectUrl is required and missing from your config'], 11 | level: 'error', 12 | }; 13 | } 14 | 15 | return POSITIVE_VALIDATION_RESULT; 16 | }; 17 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auth0/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import { getTestBed } from '@angular/core/testing'; 4 | import { 5 | BrowserDynamicTestingModule, 6 | platformBrowserDynamicTesting, 7 | } from '@angular/platform-browser-dynamic/testing'; 8 | import 'zone.js/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting(), 14 | { 15 | teardown: { destroyAfterEach: false }, 16 | } 17 | ); 18 | -------------------------------------------------------------------------------- /projects/sample-code-flow-par/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting, 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting(), 14 | { 15 | teardown: { destroyAfterEach: false }, 16 | } 17 | ); 18 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting, 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting(), 14 | { 15 | teardown: { destroyAfterEach: false }, 16 | } 17 | ); 18 | -------------------------------------------------------------------------------- /projects/sample-code-flow-popup/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting, 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting(), 14 | { 15 | teardown: { destroyAfterEach: false }, 16 | } 17 | ); 18 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { JsonPipe } from '@angular/common'; 2 | import { Component, inject } from '@angular/core'; 3 | import { OidcSecurityService } from 'angular-auth-oidc-client'; 4 | 5 | @Component({ 6 | selector: 'app-home', 7 | templateUrl: 'home.component.html', 8 | imports: [JsonPipe] 9 | }) 10 | export class HomeComponent { 11 | private readonly oidcSecurityService = inject(OidcSecurityService); 12 | protected readonly userData = this.oidcSecurityService.userData; 13 | protected readonly authenticated = this.oidcSecurityService.authenticated; 14 | } 15 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting, 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting(), 14 | { 15 | teardown: { destroyAfterEach: false }, 16 | } 17 | ); 18 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting, 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting(), 14 | { 15 | teardown: { destroyAfterEach: false }, 16 | } 17 | ); 18 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting, 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting(), 14 | { 15 | teardown: { destroyAfterEach: false }, 16 | } 17 | ); 18 | -------------------------------------------------------------------------------- /projects/sample-code-flow-http-config/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting, 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting(), 14 | { 15 | teardown: { destroyAfterEach: false }, 16 | } 17 | ); 18 | -------------------------------------------------------------------------------- /projects/sample-code-flow-lazy-loaded/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting, 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting(), 14 | { 15 | teardown: { destroyAfterEach: false }, 16 | } 17 | ); 18 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-AAD/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting, 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting(), 14 | { 15 | teardown: { destroyAfterEach: false }, 16 | } 17 | ); 18 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-iframe/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting, 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting(), 14 | { 15 | teardown: { destroyAfterEach: false }, 16 | } 17 | ); 18 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting, 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting(), 14 | { 15 | teardown: { destroyAfterEach: false }, 16 | } 17 | ); 18 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-google/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting, 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting(), 14 | { 15 | teardown: { destroyAfterEach: false }, 16 | } 17 | ); 18 | -------------------------------------------------------------------------------- /tools/build-all-angular-projects.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs-extra'); 2 | const execSync = require('child_process').execSync; 3 | const angularJson = fs.readJsonSync('./angular.json'); 4 | 5 | getApplications = (allProjects) => { 6 | return Object.entries(allProjects) 7 | .filter(([key, value]) => value.projectType === 'application') 8 | .map(([key, value]) => key); 9 | }; 10 | 11 | const allApps = getApplications(angularJson.projects); 12 | 13 | allApps.forEach((app) => { 14 | const command = `ng build ${app}`; 15 | console.log(`Running command: '${command}'`); 16 | execSync(command, { stdio: 'inherit' }); 17 | }); 18 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/test/create-retriable-stream.helper.ts: -------------------------------------------------------------------------------- 1 | import { Observable, of } from 'rxjs'; 2 | import { switchMap } from 'rxjs/operators'; 3 | 4 | // Create retriable observable stream to test retry / retryWhen. Credits to: 5 | // https://stackoverflow.com/questions/51399819/how-to-create-a-mock-observable-to-test-http-rxjs-retry-retrywhen-in-angular 6 | export const createRetriableStream = (...resp$: any): Observable => { 7 | const fetchData: jasmine.Spy = jasmine.createSpy('fetchData'); 8 | 9 | fetchData.and.returnValues(...resp$); 10 | 11 | return of(null).pipe(switchMap((_) => fetchData())); 12 | }; 13 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting, 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting(), 14 | { 15 | teardown: { destroyAfterEach: false }, 16 | } 17 | ); 18 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Azure-B2C/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting, 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting(), 14 | { 15 | teardown: { destroyAfterEach: false }, 16 | } 17 | ); 18 | -------------------------------------------------------------------------------- /projects/sample-code-flow-refresh-tokens/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting, 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting(), 14 | { 15 | teardown: { destroyAfterEach: false }, 16 | } 17 | ); 18 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-silent-renew/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting, 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting(), 14 | { 15 | teardown: { destroyAfterEach: false }, 16 | } 17 | ); 18 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/flows/callback-handling/error-helper.ts: -------------------------------------------------------------------------------- 1 | import { HttpErrorResponse } from '@angular/common/http'; 2 | 3 | /** 4 | * checks if the error is a network error 5 | * by checking if either internal error is a ProgressEvent with type error 6 | * or another error with status 0 7 | * @param error 8 | * @returns true if the error is a network error 9 | */ 10 | export const isNetworkError = (error: unknown): boolean => 11 | !!error && 12 | error instanceof HttpErrorResponse && 13 | ((error.error instanceof ProgressEvent && error.error.type === 'error') || 14 | (error.status === 0 && !!error.error)); 15 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import { getTestBed } from '@angular/core/testing'; 4 | import { 5 | BrowserDynamicTestingModule, 6 | platformBrowserDynamicTesting, 7 | } from '@angular/platform-browser-dynamic/testing'; 8 | import 'zone.js'; 9 | import 'zone.js/testing'; 10 | 11 | // First, initialize the Angular testing environment. 12 | getTestBed().initTestEnvironment( 13 | BrowserDynamicTestingModule, 14 | platformBrowserDynamicTesting(), 15 | { 16 | teardown: { destroyAfterEach: false }, 17 | } 18 | ); 19 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4-popup/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting, 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting(), 14 | { 15 | teardown: { destroyAfterEach: false }, 16 | } 17 | ); 18 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-google/src/app/auto-login/auto-login.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, inject } from '@angular/core'; 2 | import { OidcSecurityService } from 'angular-auth-oidc-client'; 3 | 4 | @Component({ 5 | selector: 'app-auto-component', 6 | templateUrl: './auto-login.component.html', 7 | standalone: false 8 | }) 9 | export class AutoLoginComponent implements OnInit { 10 | private readonly oidcSecurityService = inject(OidcSecurityService); 11 | 12 | ngOnInit(): void { 13 | this.oidcSecurityService 14 | .checkAuth() 15 | .subscribe(() => this.oidcSecurityService.authorize()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /projects/schematics/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "schematics", 3 | "version": "21.0.1", 4 | "description": "A schematic for the Angular Lib for OpenID Connect & OAuth2", 5 | "scripts": { 6 | "build": "tsc -p tsconfig.json", 7 | "test": "npm run build && jasmine src/**/*_spec.js" 8 | }, 9 | "keywords": [ 10 | "schematics" 11 | ], 12 | "author": "", 13 | "license": "MIT", 14 | "schematics": "./src/collection.json", 15 | "dependencies": { 16 | "@schematics/angular": "^20.2.2", 17 | "@angular-devkit/core": "^20.2.2", 18 | "@angular-devkit/schematics": "^20.2.2", 19 | "typescript": "~5.4.5" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /projects/schematics/src/ng-add/models/ng-add-options.ts: -------------------------------------------------------------------------------- 1 | import { FlowType } from '../schema'; 2 | 3 | export interface ModuleInfo { 4 | moduleFileName: string; 5 | moduleName: string; 6 | filesFolder: string; 7 | } 8 | 9 | export interface StandaloneInfo { 10 | fileName: string; 11 | configName: string; 12 | filesFolder: string; 13 | } 14 | 15 | export interface NgAddOptions { 16 | authorityUrlOrTenantId: string; 17 | flowType: FlowType; 18 | isHttpOption: boolean; 19 | needsSilentRenewHtml: boolean; 20 | moduleInfo: ModuleInfo|undefined; 21 | standaloneInfo: StandaloneInfo|undefined; 22 | useLocalPackage: boolean; 23 | } 24 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auth0/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, inject } from '@angular/core'; 2 | import { OidcSecurityService } from 'angular-auth-oidc-client'; 3 | 4 | @Component({ 5 | selector: 'app-root', 6 | templateUrl: 'app.component.html', 7 | standalone: false 8 | }) 9 | export class AppComponent implements OnInit { 10 | private readonly oidcSecurityService = inject(OidcSecurityService); 11 | 12 | ngOnInit(): void { 13 | this.oidcSecurityService 14 | .checkAuth() 15 | .subscribe(({ isAuthenticated }) => 16 | console.log('app authenticated', isAuthenticated) 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/logging/console-logger.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { AbstractLoggerService } from './abstract-logger.service'; 3 | 4 | @Injectable({ providedIn: 'root' }) 5 | export class ConsoleLoggerService implements AbstractLoggerService { 6 | logError(message: string | object, ...args: any[]): void { 7 | console.error(message, ...args); 8 | } 9 | 10 | logWarning(message: string | object, ...args: any[]): void { 11 | console.warn(message, ...args); 12 | } 13 | 14 | logDebug(message: string | object, ...args: any[]): void { 15 | console.debug(message, ...args); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-silent-renew/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, inject } from '@angular/core'; 2 | import { OidcSecurityService } from 'angular-auth-oidc-client'; 3 | 4 | @Component({ 5 | selector: 'app-root', 6 | templateUrl: 'app.component.html', 7 | standalone: false 8 | }) 9 | export class AppComponent implements OnInit { 10 | private readonly oidcSecurityService = inject(OidcSecurityService); 11 | 12 | ngOnInit(): void { 13 | this.oidcSecurityService 14 | .checkAuthIncludingServer() 15 | .subscribe((isAuthenticated) => 16 | console.log('app authenticated', isAuthenticated) 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/api/http-base.service.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient } from '@angular/common/http'; 2 | import { Injectable, inject } from '@angular/core'; 3 | import { Observable } from 'rxjs'; 4 | 5 | @Injectable({ providedIn: 'root' }) 6 | export class HttpBaseService { 7 | private readonly http = inject(HttpClient); 8 | 9 | get(url: string, params?: { [key: string]: unknown }): Observable { 10 | return this.http.get(url, params); 11 | } 12 | 13 | post( 14 | url: string, 15 | body: unknown, 16 | params?: { [key: string]: unknown } 17 | ): Observable { 18 | return this.http.post(url, body, params); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /projects/integration-tests/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ 2 | /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ 3 | { 4 | "extends": "../../tsconfig.json", 5 | "compilerOptions": { 6 | "outDir": "../../out-tsc/spec", 7 | "types": [ 8 | "jasmine", 9 | "node" 10 | ] 11 | }, 12 | "include": [ 13 | "src/**/*.spec.ts", 14 | "src/**/*.d.ts", 15 | "src/tests/**/*.spec.ts", 16 | "src/tests/**/*.ts" 17 | ], 18 | "exclude": [ 19 | "test-idp-server/**/*" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /projects/sample-code-flow-lazy-loaded/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { 2 | provideHttpClient, 3 | withInterceptorsFromDi, 4 | } from '@angular/common/http'; 5 | import { NgModule } from '@angular/core'; 6 | import { BrowserModule } from '@angular/platform-browser'; 7 | import { AppRoutingModule } from './app-routing.module'; 8 | import { AppComponent } from './app.component'; 9 | import { AuthConfigModule } from './auth-config.module'; 10 | 11 | @NgModule({ 12 | declarations: [AppComponent], 13 | bootstrap: [AppComponent], 14 | imports: [BrowserModule, AppRoutingModule, AuthConfigModule], 15 | providers: [provideHttpClient(withInterceptorsFromDi())], 16 | }) 17 | export class AppModule {} 18 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/storage/default-localstorage.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { AbstractSecurityStorage } from './abstract-security-storage'; 3 | 4 | @Injectable({ 5 | providedIn: 'root', 6 | }) 7 | export class DefaultLocalStorageService implements AbstractSecurityStorage { 8 | public read(key: string): string | null { 9 | return localStorage.getItem(key); 10 | } 11 | 12 | public write(key: string, value: string): void { 13 | localStorage.setItem(key, value); 14 | } 15 | 16 | public remove(key: string): void { 17 | localStorage.removeItem(key); 18 | } 19 | 20 | public clear(): void { 21 | localStorage.clear(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/storage/default-sessionstorage.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { AbstractSecurityStorage } from './abstract-security-storage'; 3 | 4 | @Injectable({ providedIn: 'root' }) 5 | export class DefaultSessionStorageService implements AbstractSecurityStorage { 6 | public read(key: string): string | null { 7 | return sessionStorage.getItem(key); 8 | } 9 | 10 | public write(key: string, value: string): void { 11 | sessionStorage.setItem(key, value); 12 | } 13 | 14 | public remove(key: string): void { 15 | sessionStorage.removeItem(key); 16 | } 17 | 18 | public clear(): void { 19 | sessionStorage.clear(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '[Feature Request]: ' 5 | labels: '' 6 | assignees: '' 7 | --- 8 | 9 | **Is your feature request related to a problem? Please describe.** 10 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 11 | 12 | **Describe the solution you'd like** 13 | A clear and concise description of what you want to happen. 14 | 15 | **Describe alternatives you've considered** 16 | A clear and concise description of any alternative solutions or features you've considered. 17 | 18 | **Additional context** 19 | Add any other context or screenshots about the feature request here. 20 | -------------------------------------------------------------------------------- /projects/sample-code-flow-par/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, inject } from '@angular/core'; 2 | import { OidcSecurityService } from 'angular-auth-oidc-client'; 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: 'app.component.html', 6 | standalone: false 7 | }) 8 | export class AppComponent implements OnInit { 9 | private readonly oidcSecurityService = inject(OidcSecurityService); 10 | 11 | ngOnInit() { 12 | this.oidcSecurityService 13 | .checkAuth() 14 | .subscribe(({ isAuthenticated, userData, accessToken }) => { 15 | console.log('app authenticated', isAuthenticated); 16 | console.log(`Current access token is '${accessToken}'`); 17 | }); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /projects/integration-tests/test-idp-server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test-idp-server", 3 | "version": "1.0.0", 4 | "description": "Test OIDC Identity Provider server", 5 | "scripts": { 6 | "start": "ts-node src/index.ts", 7 | "dev": "export PORT=8081; nodemon --exec ts-node src/index.ts" 8 | }, 9 | "dependencies": { 10 | "express": "^4.18.2", 11 | "jose": "^5.2.0", 12 | "cors": "^2.8.5", 13 | "cookie-parser": "^1.4.6" 14 | }, 15 | "devDependencies": { 16 | "@types/express": "^4.17.21", 17 | "@types/node": "^20.10.0", 18 | "@types/cors": "^2.8.17", 19 | "@types/cookie-parser": "^1.4.6", 20 | "typescript": "^5.3.0", 21 | "ts-node": "^10.9.2", 22 | "nodemon": "^3.0.2" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /projects/integration-tests/test-idp-server/src/index.ts: -------------------------------------------------------------------------------- 1 | import { TestIdpServer } from './TestIdpServer'; 2 | 3 | // Start the server if run directly 4 | if (require.main === module) { 5 | const port = parseInt(process.env.PORT || '8080', 10); 6 | const server = new TestIdpServer({ 7 | port, 8 | realms: ['idp1', 'idp2', 'idp3'] 9 | }); 10 | 11 | server.start().then(() => { 12 | console.log(`Test IDP server is running on port ${port}`); 13 | console.log('Press Ctrl+C to stop the server'); 14 | 15 | process.on('SIGINT', async () => { 16 | console.log('\nStopping server...'); 17 | await server.stop(); 18 | process.exit(0); 19 | }); 20 | }).catch(console.error); 21 | } 22 | 23 | export { TestIdpServer }; -------------------------------------------------------------------------------- /projects/sample-code-flow-refresh-tokens/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, inject } from '@angular/core'; 2 | import { OidcSecurityService } from 'angular-auth-oidc-client'; 3 | 4 | @Component({ 5 | selector: 'app-root', 6 | templateUrl: 'app.component.html', 7 | standalone: false 8 | }) 9 | export class AppComponent implements OnInit { 10 | private readonly oidcSecurityService = inject(OidcSecurityService); 11 | 12 | ngOnInit(): void { 13 | this.oidcSecurityService 14 | .checkAuth() 15 | .subscribe(({ isAuthenticated, accessToken }) => { 16 | console.log('app authenticated', isAuthenticated); 17 | console.log(`Current access token is '${accessToken}'`); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /docs/site/angular-auth-oidc-client/sidebars.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creating a sidebar enables you to: 3 | - create an ordered group of docs 4 | - render a sidebar for each doc of that group 5 | - provide next/previous navigation 6 | 7 | The sidebars can be generated from the filesystem, or explicitly defined here. 8 | 9 | Create as many sidebars as you want. 10 | */ 11 | 12 | module.exports = { 13 | // By default, Docusaurus generates a sidebar from the docs folder structure 14 | tutorialSidebar: [{type: 'autogenerated', dirName: '.'}], 15 | 16 | // But you can create a sidebar manually 17 | /* 18 | tutorialSidebar: [ 19 | { 20 | type: 'category', 21 | label: 'Tutorial', 22 | items: ['hello'], 23 | }, 24 | ], 25 | */ 26 | }; 27 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/utils/url/current-url.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable, inject, DOCUMENT } from '@angular/core'; 2 | 3 | @Injectable({ providedIn: 'root' }) 4 | export class CurrentUrlService { 5 | private readonly document: Document = inject(DOCUMENT); 6 | 7 | getStateParamFromCurrentUrl(url?: string): string | null { 8 | const currentUrl = url || this.getCurrentUrl(); 9 | 10 | if (!currentUrl) { 11 | return null; 12 | } 13 | 14 | const parsedUrl = new URL(currentUrl); 15 | const urlParams = new URLSearchParams(parsedUrl.search); 16 | 17 | return urlParams.get('state'); 18 | } 19 | 20 | getCurrentUrl(): string | null { 21 | return this.document?.defaultView?.location.toString() ?? null; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /projects/sample-code-flow-par/src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; 2 | import { HomeComponent } from './home.component'; 3 | 4 | describe('HomeComponent', () => { 5 | let component: HomeComponent; 6 | let fixture: ComponentFixture; 7 | 8 | beforeEach(waitForAsync(() => { 9 | TestBed.configureTestingModule({ 10 | declarations: [HomeComponent], 11 | }).compileComponents(); 12 | })); 13 | 14 | beforeEach(() => { 15 | fixture = TestBed.createComponent(HomeComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auth0/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 |
Welcome to home Route
2 | 3 | @if (isAuthenticated) { 4 |
5 | 6 | 7 | 8 | 9 |
10 |
11 | Is Authenticated: {{ isAuthenticated }} 12 |
13 | userData 14 |
{{ userData$ | async | json }}
15 |
16 |
17 | } @else { 18 | 19 |
20 | } 21 | 22 | 23 | Configuration loaded: 24 |
{{ configuration$ | async | json }}
25 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auth0/src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; 2 | import { HomeComponent } from './home.component'; 3 | 4 | describe('HomeComponent', () => { 5 | let component: HomeComponent; 6 | let fixture: ComponentFixture; 7 | 8 | beforeEach(waitForAsync(() => { 9 | TestBed.configureTestingModule({ 10 | declarations: [HomeComponent], 11 | }).compileComponents(); 12 | })); 13 | 14 | beforeEach(() => { 15 | fixture = TestBed.createComponent(HomeComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auth0/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-AAD/src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; 2 | import { HomeComponent } from './home.component'; 3 | 4 | describe('HomeComponent', () => { 5 | let component: HomeComponent; 6 | let fixture: ComponentFixture; 7 | 8 | beforeEach(waitForAsync(() => { 9 | TestBed.configureTestingModule({ 10 | declarations: [HomeComponent], 11 | }).compileComponents(); 12 | })); 13 | 14 | beforeEach(() => { 15 | fixture = TestBed.createComponent(HomeComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /projects/sample-code-flow-par/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /projects/sample-code-flow-popup/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/callback/callback.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CallbackComponent } from './callback.component'; 4 | 5 | describe('CallbackComponent', () => { 6 | let component: CallbackComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [CallbackComponent], 12 | }).compileComponents(); 13 | 14 | fixture = TestBed.createComponent(CallbackComponent); 15 | component = fixture.componentInstance; 16 | fixture.detectChanges(); 17 | }); 18 | 19 | it('should create', () => { 20 | expect(component).toBeTruthy(); 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; 2 | import { HomeComponent } from './home.component'; 3 | 4 | describe('HomeComponent', () => { 5 | let component: HomeComponent; 6 | let fixture: ComponentFixture; 7 | 8 | beforeEach(waitForAsync(() => { 9 | TestBed.configureTestingModule({ 10 | declarations: [HomeComponent], 11 | }).compileComponents(); 12 | })); 13 | 14 | beforeEach(() => { 15 | fixture = TestBed.createComponent(HomeComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /projects/sample-code-flow-http-config/src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; 2 | import { HomeComponent } from './home.component'; 3 | 4 | describe('HomeComponent', () => { 5 | let component: HomeComponent; 6 | let fixture: ComponentFixture; 7 | 8 | beforeEach(waitForAsync(() => { 9 | TestBed.configureTestingModule({ 10 | declarations: [HomeComponent], 11 | }).compileComponents(); 12 | })); 13 | 14 | beforeEach(() => { 15 | fixture = TestBed.createComponent(HomeComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /projects/sample-code-flow-http-config/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /projects/sample-code-flow-lazy-loaded/src/app/lazy/lazy.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; 2 | import { LazyComponent } from './lazy.component'; 3 | 4 | describe('LazyComponent', () => { 5 | let component: LazyComponent; 6 | let fixture: ComponentFixture; 7 | 8 | beforeEach(waitForAsync(() => { 9 | TestBed.configureTestingModule({ 10 | declarations: [LazyComponent], 11 | }).compileComponents(); 12 | })); 13 | 14 | beforeEach(() => { 15 | fixture = TestBed.createComponent(LazyComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /projects/sample-code-flow-lazy-loaded/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-AAD/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-iframe/src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; 2 | import { HomeComponent } from './home.component'; 3 | 4 | describe('HomeComponent', () => { 5 | let component: HomeComponent; 6 | let fixture: ComponentFixture; 7 | 8 | beforeEach(waitForAsync(() => { 9 | TestBed.configureTestingModule({ 10 | declarations: [HomeComponent], 11 | }).compileComponents(); 12 | })); 13 | 14 | beforeEach(() => { 15 | fixture = TestBed.createComponent(HomeComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /projects/sample-code-flow-refresh-tokens/src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; 2 | import { HomeComponent } from './home.component'; 3 | 4 | describe('HomeComponent', () => { 5 | let component: HomeComponent; 6 | let fixture: ComponentFixture; 7 | 8 | beforeEach(waitForAsync(() => { 9 | TestBed.configureTestingModule({ 10 | declarations: [HomeComponent], 11 | }).compileComponents(); 12 | })); 13 | 14 | beforeEach(() => { 15 | fixture = TestBed.createComponent(HomeComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; 2 | import { HomeComponent } from './home.component'; 3 | 4 | describe('HomeComponent', () => { 5 | let component: HomeComponent; 6 | let fixture: ComponentFixture; 7 | 8 | beforeEach(waitForAsync(() => { 9 | TestBed.configureTestingModule({ 10 | declarations: [HomeComponent], 11 | }).compileComponents(); 12 | })); 13 | 14 | beforeEach(() => { 15 | fixture = TestBed.createComponent(HomeComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-google/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4/src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; 2 | import { HomeComponent } from './home.component'; 3 | 4 | describe('HomeComponent', () => { 5 | let component: HomeComponent; 6 | let fixture: ComponentFixture; 7 | 8 | beforeEach(waitForAsync(() => { 9 | TestBed.configureTestingModule({ 10 | declarations: [HomeComponent], 11 | }).compileComponents(); 12 | })); 13 | 14 | beforeEach(() => { 15 | fixture = TestBed.createComponent(HomeComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Azure-B2C/src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; 2 | import { HomeComponent } from './home.component'; 3 | 4 | describe('HomeComponent', () => { 5 | let component: HomeComponent; 6 | let fixture: ComponentFixture; 7 | 8 | beforeEach(waitForAsync(() => { 9 | TestBed.configureTestingModule({ 10 | declarations: [HomeComponent], 11 | }).compileComponents(); 12 | })); 13 | 14 | beforeEach(() => { 15 | fixture = TestBed.createComponent(HomeComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Azure-B2C/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-iframe/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /projects/sample-code-flow-refresh-tokens/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-google/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { RouterModule, Routes } from '@angular/router'; 2 | import { AutoLoginComponent } from './auto-login/auto-login.component'; 3 | import { ForbiddenComponent } from './forbidden/forbidden.component'; 4 | import { HomeComponent } from './home/home.component'; 5 | import { UnauthorizedComponent } from './unauthorized/unauthorized.component'; 6 | 7 | const appRoutes: Routes = [ 8 | { path: '', component: HomeComponent }, 9 | { path: 'home', component: HomeComponent }, 10 | { path: 'autologin', component: AutoLoginComponent }, 11 | { path: 'forbidden', component: ForbiddenComponent }, 12 | { path: 'unauthorized', component: UnauthorizedComponent }, 13 | ]; 14 | 15 | export const routing = RouterModule.forRoot(appRoutes); 16 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-silent-renew/src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; 2 | import { HomeComponent } from './home.component'; 3 | 4 | describe('HomeComponent', () => { 5 | let component: HomeComponent; 6 | let fixture: ComponentFixture; 7 | 8 | beforeEach(waitForAsync(() => { 9 | TestBed.configureTestingModule({ 10 | declarations: [HomeComponent], 11 | }).compileComponents(); 12 | })); 13 | 14 | beforeEach(() => { 15 | fixture = TestBed.createComponent(HomeComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-silent-renew/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; 2 | import { HomeComponent } from './home.component'; 3 | 4 | describe('HomeComponent', () => { 5 | let component: HomeComponent; 6 | let fixture: ComponentFixture; 7 | 8 | beforeEach(waitForAsync(() => { 9 | TestBed.configureTestingModule({ 10 | declarations: [HomeComponent], 11 | }).compileComponents(); 12 | })); 13 | 14 | beforeEach(() => { 15 | fixture = TestBed.createComponent(HomeComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/plugins/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4-popup/src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; 2 | import { HomeComponent } from './home.component'; 3 | 4 | describe('HomeComponent', () => { 5 | let component: HomeComponent; 6 | let fixture: ComponentFixture; 7 | 8 | beforeEach(waitForAsync(() => { 9 | TestBed.configureTestingModule({ 10 | declarations: [HomeComponent], 11 | }).compileComponents(); 12 | })); 13 | 14 | beforeEach(() => { 15 | fixture = TestBed.createComponent(HomeComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4-popup/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/app/forbidden/forbidden.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, inject } from '@angular/core'; 2 | import { OidcSecurityService } from 'angular-auth-oidc-client'; 3 | 4 | @Component({ 5 | selector: 'app-forbidden', 6 | templateUrl: 'forbidden.component.html', 7 | standalone: false 8 | }) 9 | export class ForbiddenComponent implements OnInit { 10 | private readonly oidcSecurityService = inject(OidcSecurityService); 11 | 12 | public isAuthenticated = false; 13 | 14 | ngOnInit(): void { 15 | this.oidcSecurityService.isAuthenticated$.subscribe( 16 | ({ isAuthenticated }) => { 17 | this.isAuthenticated = isAuthenticated; 18 | 19 | console.warn('authenticated: ', isAuthenticated); 20 | } 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /projects/sample-code-flow-lazy-loaded/src/app/auth-config.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { AuthModule, LogLevel } from 'angular-auth-oidc-client'; 3 | 4 | @NgModule({ 5 | imports: [ 6 | AuthModule.forRoot({ 7 | config: { 8 | authority: 'https://offeringsolutions-sts.azurewebsites.net', 9 | redirectUrl: window.location.origin, 10 | postLogoutRedirectUri: window.location.origin, 11 | clientId: 'angularCodeRefreshTokens', 12 | scope: 'openid profile email offline_access', 13 | responseType: 'code', 14 | silentRenew: true, 15 | useRefreshToken: true, 16 | logLevel: LogLevel.Debug, 17 | }, 18 | }), 19 | ], 20 | exports: [AuthModule], 21 | }) 22 | export class AuthConfigModule {} 23 | -------------------------------------------------------------------------------- /projects/schematics/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "tsconfig", 4 | "lib": ["es2018", "dom"], 5 | "declaration": true, 6 | "module": "commonjs", 7 | "moduleResolution": "node", 8 | "noEmitOnError": true, 9 | "noFallthroughCasesInSwitch": true, 10 | "noImplicitAny": true, 11 | "noImplicitThis": true, 12 | "noUnusedParameters": false, 13 | "noUnusedLocals": true, 14 | "rootDir": "src/", 15 | "skipDefaultLibCheck": true, 16 | "skipLibCheck": true, 17 | "sourceMap": true, 18 | "strictNullChecks": true, 19 | "target": "es6", 20 | "outDir": "../../dist/angular-auth-oidc-client/schematics", 21 | "types": ["jasmine", "node"] 22 | }, 23 | "include": ["src/**/*"], 24 | "exclude": ["src/*/files/**/*"] 25 | } 26 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/auth.module.ts: -------------------------------------------------------------------------------- 1 | import { CommonModule } from '@angular/common'; 2 | import { 3 | provideHttpClient, 4 | withInterceptorsFromDi, 5 | } from '@angular/common/http'; 6 | import { ModuleWithProviders, NgModule } from '@angular/core'; 7 | import { PassedInitialConfig } from './auth-config'; 8 | import { _provideAuth } from './provide-auth'; 9 | 10 | @NgModule({ 11 | declarations: [], 12 | exports: [], 13 | imports: [CommonModule], 14 | providers: [provideHttpClient(withInterceptorsFromDi())], 15 | }) 16 | export class AuthModule { 17 | static forRoot( 18 | passedConfig: PassedInitialConfig 19 | ): ModuleWithProviders { 20 | return { 21 | ngModule: AuthModule, 22 | providers: [..._provideAuth(passedConfig)], 23 | }; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/auth-config.ts: -------------------------------------------------------------------------------- 1 | import { InjectionToken, Provider } from '@angular/core'; 2 | import { 3 | StsConfigLoader, 4 | StsConfigStaticLoader, 5 | } from './config/loader/config-loader'; 6 | import { OpenIdConfiguration } from './config/openid-configuration'; 7 | 8 | export interface PassedInitialConfig { 9 | config?: OpenIdConfiguration | OpenIdConfiguration[]; 10 | loader?: Provider; 11 | } 12 | 13 | export function createStaticLoader( 14 | passedConfig: PassedInitialConfig 15 | ): StsConfigLoader { 16 | if (!passedConfig?.config) { 17 | throw new Error('No config provided!'); 18 | } 19 | 20 | return new StsConfigStaticLoader(passedConfig.config); 21 | } 22 | 23 | export const PASSED_CONFIG = new InjectionToken( 24 | 'PASSED_CONFIG' 25 | ); 26 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login/src/app/customers/customers.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CustomersComponent } from './customers.component'; 4 | 5 | describe('CustomersComponent', () => { 6 | let component: CustomersComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [CustomersComponent], 12 | }).compileComponents(); 13 | }); 14 | 15 | beforeEach(() => { 16 | fixture = TestBed.createComponent(CustomersComponent); 17 | component = fixture.componentInstance; 18 | fixture.detectChanges(); 19 | }); 20 | 21 | it('should create', () => { 22 | expect(component).toBeTruthy(); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/src/app/forbidden/forbidden.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; 2 | import { ForbiddenComponent } from './forbidden.component'; 3 | 4 | describe('ForbiddenComponent', () => { 5 | let component: ForbiddenComponent; 6 | let fixture: ComponentFixture; 7 | 8 | beforeEach(waitForAsync(() => { 9 | TestBed.configureTestingModule({ 10 | imports: [ForbiddenComponent], 11 | }).compileComponents(); 12 | })); 13 | 14 | beforeEach(() => { 15 | fixture = TestBed.createComponent(ForbiddenComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azuread/src/app/protected/protected.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; 2 | import { ProtectedComponent } from './protected.component'; 3 | 4 | describe('ProtectedComponent', () => { 5 | let component: ProtectedComponent; 6 | let fixture: ComponentFixture; 7 | 8 | beforeEach(waitForAsync(() => { 9 | TestBed.configureTestingModule({ 10 | imports: [ProtectedComponent], 11 | }).compileComponents(); 12 | })); 13 | 14 | beforeEach(() => { 15 | fixture = TestBed.createComponent(ProtectedComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-AAD/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, inject } from '@angular/core'; 2 | import { OidcSecurityService } from 'angular-auth-oidc-client'; 3 | 4 | @Component({ 5 | selector: 'app-root', 6 | templateUrl: 'app.component.html', 7 | standalone: false 8 | }) 9 | export class AppComponent implements OnInit { 10 | private readonly oidcSecurityService = inject(OidcSecurityService); 11 | 12 | ngOnInit(): void { 13 | this.oidcSecurityService 14 | .checkAuthMultiple() 15 | .subscribe(([{ isAuthenticated, userData, accessToken }]) => { 16 | console.log('Authenticated', isAuthenticated); 17 | console.log('Received Userdata', userData); 18 | console.log(`Current access token is '${accessToken}'`); 19 | }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-iframe/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, inject } from '@angular/core'; 2 | import { OidcSecurityService } from 'angular-auth-oidc-client'; 3 | 4 | @Component({ 5 | selector: 'app-root', 6 | templateUrl: 'app.component.html', 7 | standalone: false 8 | }) 9 | export class AppComponent implements OnInit { 10 | private readonly oidcSecurityService = inject(OidcSecurityService); 11 | 12 | ngOnInit(): void { 13 | this.oidcSecurityService 14 | .checkAuthMultiple() 15 | .subscribe(([{ isAuthenticated, userData, accessToken }]) => { 16 | console.log('Authenticated', isAuthenticated); 17 | console.log('Received Userdata', userData); 18 | console.log(`Current access token is '${accessToken}'`); 19 | }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /projects/sample-code-flow-standalone/src/app/customers/customers.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CustomersComponent } from './customers.component'; 4 | 5 | describe('CustomersComponent', () => { 6 | let component: CustomersComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [CustomersComponent], 12 | }).compileComponents(); 13 | }); 14 | 15 | beforeEach(() => { 16 | fixture = TestBed.createComponent(CustomersComponent); 17 | component = fixture.componentInstance; 18 | fixture.detectChanges(); 19 | }); 20 | 21 | it('should create', () => { 22 | expect(component).toBeTruthy(); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /projects/sample-implicit-flow-silent-renew/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 |
Welcome to home Route
2 | 3 | @if (checkSessionChanged$ | async) { 4 | 7 | } 8 | 9 | @if (isAuthenticated) { 10 |
11 | 12 | 13 |
14 |
15 | Is Authenticated: {{ isAuthenticated }} 16 |
17 | userData 18 |
{{ userData$ | async | json }}
19 | {{ checkSessionChanged$ | async }} 20 |
21 |
22 | } @else { 23 | 24 |
25 | } 26 | 27 | 28 | Configuration loaded: 29 |
{{ configuration$ | async | json }}
30 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/src/app/forbidden/forbidden.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; 2 | import { ForbiddenComponent } from './forbidden.component'; 3 | 4 | describe('ForbiddenComponent', () => { 5 | let component: ForbiddenComponent; 6 | let fixture: ComponentFixture; 7 | 8 | beforeEach(waitForAsync(() => { 9 | TestBed.configureTestingModule({ 10 | declarations: [ForbiddenComponent], 11 | }).compileComponents(); 12 | })); 13 | 14 | beforeEach(() => { 15 | fixture = TestBed.createComponent(ForbiddenComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /projects/sample-code-flow-azure-b2c/src/app/protected/protected.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; 2 | import { ProtectedComponent } from './protected.component'; 3 | 4 | describe('ProtectedComponent', () => { 5 | let component: ProtectedComponent; 6 | let fixture: ComponentFixture; 7 | 8 | beforeEach(waitForAsync(() => { 9 | TestBed.configureTestingModule({ 10 | declarations: [ProtectedComponent], 11 | }).compileComponents(); 12 | })); 13 | 14 | beforeEach(() => { 15 | fixture = TestBed.createComponent(ProtectedComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Auth0-ID4/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, inject } from '@angular/core'; 2 | import { OidcSecurityService } from 'angular-auth-oidc-client'; 3 | 4 | @Component({ 5 | selector: 'app-root', 6 | templateUrl: 'app.component.html', 7 | standalone: false 8 | }) 9 | export class AppComponent implements OnInit { 10 | private readonly oidcSecurityService = inject(OidcSecurityService); 11 | 12 | ngOnInit(): void { 13 | this.oidcSecurityService 14 | .checkAuthMultiple() 15 | .subscribe(([{ isAuthenticated, userData, accessToken }]) => { 16 | console.log('Authenticated', isAuthenticated); 17 | console.log('Received Userdata', userData); 18 | console.log(`Current access token is '${accessToken}'`); 19 | }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /projects/sample-code-flow-multi-Azure-B2C/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, inject } from '@angular/core'; 2 | import { OidcSecurityService } from 'angular-auth-oidc-client'; 3 | 4 | @Component({ 5 | selector: 'app-root', 6 | templateUrl: 'app.component.html', 7 | standalone: false 8 | }) 9 | export class AppComponent implements OnInit { 10 | private readonly oidcSecurityService = inject(OidcSecurityService); 11 | 12 | ngOnInit(): void { 13 | this.oidcSecurityService 14 | .checkAuthMultiple() 15 | .subscribe(([{ isAuthenticated, userData, accessToken }]) => { 16 | console.log('Authenticated', isAuthenticated); 17 | console.log('Received Userdata', userData); 18 | console.log(`Current access token is '${accessToken}'`); 19 | }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /projects/angular-auth-oidc-client/src/lib/validation/validation-result.ts: -------------------------------------------------------------------------------- 1 | export enum ValidationResult { 2 | NotSet = 'NotSet', 3 | StatesDoNotMatch = 'StatesDoNotMatch', 4 | SignatureFailed = 'SignatureFailed', 5 | IncorrectNonce = 'IncorrectNonce', 6 | RequiredPropertyMissing = 'RequiredPropertyMissing', 7 | MaxOffsetExpired = 'MaxOffsetExpired', 8 | IssDoesNotMatchIssuer = 'IssDoesNotMatchIssuer', 9 | NoAuthWellKnownEndPoints = 'NoAuthWellKnownEndPoints', 10 | IncorrectAud = 'IncorrectAud', 11 | IncorrectIdTokenClaimsAfterRefresh = 'IncorrectIdTokenClaimsAfterRefresh', 12 | IncorrectAzp = 'IncorrectAzp', 13 | TokenExpired = 'TokenExpired', 14 | IncorrectAtHash = 'IncorrectAtHash', 15 | Ok = 'Ok', 16 | LoginRequired = 'LoginRequired', 17 | SecureTokenServerError = 'SecureTokenServerError', 18 | } 19 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, inject } from '@angular/core'; 2 | import { OidcSecurityService } from 'angular-auth-oidc-client'; 3 | 4 | @Component({ 5 | selector: 'app-root', 6 | templateUrl: './app.component.html', 7 | styleUrls: ['./app.component.css'], 8 | standalone: false 9 | }) 10 | export class AppComponent { 11 | private readonly oidcSecurityService = inject(OidcSecurityService); 12 | 13 | title = 'sample-code-flow-auto-login-all-routes'; 14 | 15 | ngOnInit() { 16 | this.oidcSecurityService 17 | .checkAuth() 18 | .subscribe( 19 | ({ isAuthenticated, userData, accessToken, idToken, configId }) => { 20 | console.log('callback authenticated', isAuthenticated); 21 | } 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /projects/sample-code-flow-auto-login-all-routes/src/app/customers/customers.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CustomersComponent } from './customers.component'; 4 | 5 | describe('CustomersComponent', () => { 6 | let component: CustomersComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [CustomersComponent], 12 | }).compileComponents(); 13 | }); 14 | 15 | beforeEach(() => { 16 | fixture = TestBed.createComponent(CustomersComponent); 17 | component = fixture.componentInstance; 18 | fixture.detectChanges(); 19 | }); 20 | 21 | it('should create', () => { 22 | expect(component).toBeTruthy(); 23 | }); 24 | }); 25 | --------------------------------------------------------------------------------