You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30-2
Original file line number
Diff line number
Diff line change
@@ -20,14 +20,18 @@ Support for OAuth 2 and OpenId Connect (OIDC) in Angular. Already prepared for t
20
20
21
21
## Tested Environment
22
22
23
-
Successfully tested with **Angular 4.3 to Angular 12** and its Router, PathLocationStrategy as well as HashLocationStrategy and CommonJS-Bundling via webpack.
23
+
Successfully tested with **Angular 4.3 to Angular 15** and its Router, PathLocationStrategy as well as HashLocationStrategy and CommonJS-Bundling via webpack.
24
24
25
25
At server side we've used **IdentityServer** (.NET / .NET Core), Redhat's **Keycloak** (Java), and **Auth0** (Auth0 is officially supported since version 10 of this lib). For Auth0, please have a look into the respective documentation page here.
26
26
27
27
For using this library with **Azure Active Directory** (**Azure AD**), we recommend an additional look to this [blog post](https://dev.to/yuriburger/azure-active-directory-b2c-with-pkce-for-your-angular-app-1dcg) and the example linked at the end of this blog post.
28
28
29
29
Also, the Okta community created some guidelines on how to use this lib with Okta. See the links at the end of this page for more information.
30
30
31
+
**Angular 15**: Use 15.x versions of this library (**should also work with older Angular versions!**).
32
+
33
+
**Angular 14**: Use 14.x versions of this library (**should also work with older Angular versions!**).
34
+
31
35
**Angular 13**: Use 13.x versions of this library (**should also work with older Angular versions!**).
32
36
33
37
**Angular 12**: Use 12.x versions of this library (**should also work with older Angular versions!**).
@@ -107,7 +111,31 @@ _redirectUris:_
107
111
npm i angular-oauth2-oidc --save
108
112
```
109
113
110
-
## Importing the NgModule
114
+
115
+
## Option 1: Standalone APIs
116
+
117
+
If you use Standalone Components introduced with Angular 14, you can use our standalone API (call to ``provideOAuthClient``) in your ``main.ts`` to setup the ``OAuthClient``:
The ``provideOAuthClient`` function takes the same parameters as the forRoot function of the OAuthModule that is still in place for the sake of compatibility with existing code bases.
<p>Successfully tested with <strong>Angular 4.3 to Angular 12</strong> and its Router, PathLocationStrategy as well as HashLocationStrategy and CommonJS-Bundling via webpack. </p>
51
+
<p>Successfully tested with <strong>Angular 4.3 to Angular 15</strong> and its Router, PathLocationStrategy as well as HashLocationStrategy and CommonJS-Bundling via webpack. </p>
52
52
<p>At server side we've used <strong>IdentityServer</strong> (.NET / .NET Core), Redhat's <strong>Keycloak</strong> (Java), and <strong>Auth0</strong> (Auth0 is officially supported since version 10 of this lib). For Auth0, please have a look into the respective documentation page here.</p>
53
53
<p>For using this library with <strong>Azure Active Directory</strong> (<strong>Azure AD</strong>), we recommend an additional look to this <ahref="https://dev.to/yuriburger/azure-active-directory-b2c-with-pkce-for-your-angular-app-1dcg">blog post</a> and the example linked at the end of this blog post.</p>
54
54
<p>Also, the Okta community created some guidelines on how to use this lib with Okta. See the links at the end of this page for more information.</p>
55
+
<p><strong>Angular 15</strong>: Use 15.x versions of this library (<strong>should also work with older Angular versions!</strong>).</p>
56
+
<p><strong>Angular 14</strong>: Use 14.x versions of this library (<strong>should also work with older Angular versions!</strong>).</p>
55
57
<p><strong>Angular 13</strong>: Use 13.x versions of this library (<strong>should also work with older Angular versions!</strong>).</p>
56
58
<p><strong>Angular 12</strong>: Use 12.x versions of this library (<strong>should also work with older Angular versions!</strong>).</p>
57
59
<p><strong>Angular 11</strong>: Use 10.x versions of this library (<strong>should also work with older Angular versions!</strong>).</p>
<div><preclass="line-numbers"><codeclass="language-sh">npm i angular-oauth2-oidc --save</code></pre></div><h2id="importing-the-ngmodule">Importing the NgModule</h2>
123
+
<div><preclass="line-numbers"><codeclass="language-sh">npm i angular-oauth2-oidc --save</code></pre></div><h2id="option-1-standalone-apis">Option 1: Standalone APIs</h2>
124
+
<p>If you use Standalone Components introduced with Angular 14, you can use our standalone API (call to <code>provideOAuthClient</code>) in your <code>main.ts</code> to setup the <code>OAuthClient</code>:</p>
import { bootstrapApplication } from '@angular/platform-browser';
127
+
128
+
import { provideHttpClient } from '@angular/common/http';
129
+
130
+
import { AppComponent } from './app/app.component';
131
+
import { provideOAuthClient } from 'angular-oauth2-oidc';
132
+
133
+
bootstrapApplication(AppComponent, {
134
+
providers: [
135
+
provideHttpClient(),
136
+
provideOAuthClient()
137
+
]
138
+
});</code></pre></div><p>The <code>provideOAuthClient</code> function takes the same parameters as the forRoot function of the OAuthModule that is still in place for the sake of compatibility with existing code bases.</p>
139
+
<h2id="option-2-using-ngmodules">Option 2: Using NgModules</h2>
122
140
<div><preclass="line-numbers"><codeclass="language-TypeScript">import { HttpClientModule } from '@angular/common/http';
123
141
import { OAuthModule } from 'angular-oauth2-oidc';
0 commit comments