@axa-fr/react-oidc 6.0.0-alpha9 → 6.0.0-beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -9
- package/dist/OidcProvider.d.ts +2 -3
- package/dist/OidcProvider.d.ts.map +1 -1
- package/dist/OidcProvider.js +5 -4
- package/dist/OidcProvider.js.map +1 -1
- package/dist/OidcServiceWorker.js +4 -2
- package/dist/core/default-component/SilentCallback.component.d.ts.map +1 -1
- package/dist/core/default-component/SilentCallback.component.js +5 -19
- package/dist/core/default-component/SilentCallback.component.js.map +1 -1
- package/dist/core/default-component/SilentLogin.component.d.ts +4 -0
- package/dist/core/default-component/SilentLogin.component.d.ts.map +1 -0
- package/dist/core/default-component/{SilentSignin.component.js → SilentLogin.component.js} +3 -3
- package/dist/core/default-component/SilentLogin.component.js.map +1 -0
- package/dist/core/routes/OidcRoutes.d.ts +1 -1
- package/dist/core/routes/OidcRoutes.d.ts.map +1 -1
- package/dist/core/routes/OidcRoutes.js +5 -5
- package/dist/core/routes/OidcRoutes.js.map +1 -1
- package/dist/vanilla/checkSessionIFrame.d.ts +6 -6
- package/dist/vanilla/checkSessionIFrame.d.ts.map +1 -1
- package/dist/vanilla/checkSessionIFrame.js +1 -1
- package/dist/vanilla/checkSessionIFrame.js.map +1 -1
- package/dist/vanilla/oidc.d.ts +10 -9
- package/dist/vanilla/oidc.d.ts.map +1 -1
- package/dist/vanilla/oidc.js +183 -139
- package/dist/vanilla/oidc.js.map +1 -1
- package/package.json +2 -2
- package/src/oidc/OidcProvider.tsx +9 -10
- package/src/oidc/core/default-component/SilentCallback.component.tsx +1 -6
- package/src/oidc/core/default-component/{SilentSignin.component.tsx → SilentLogin.component.tsx} +2 -2
- package/src/oidc/core/routes/OidcRoutes.tsx +6 -6
- package/src/oidc/vanilla/OidcServiceWorker.js +4 -2
- package/src/oidc/vanilla/checkSessionIFrame.ts +7 -7
- package/src/oidc/vanilla/oidc.ts +122 -118
- package/dist/core/default-component/SilentSignin.component.d.ts +0 -4
- package/dist/core/default-component/SilentSignin.component.d.ts.map +0 -1
- package/dist/core/default-component/SilentSignin.component.js.map +0 -1
- package/src/App.css +0 -38
- package/src/App.specold.tsx +0 -46
- package/src/App.tsx +0 -96
- package/src/FetchUser.tsx +0 -53
- package/src/Home.tsx +0 -22
- package/src/MultiAuth.tsx +0 -116
- package/src/Profile.tsx +0 -77
- package/src/configurations.ts +0 -70
- package/src/index.css +0 -13
- package/src/index.tsx +0 -9
- package/src/logo.svg +0 -7
- package/src/override/AuthenticateError.component.tsx +0 -14
- package/src/override/Authenticating.component.tsx +0 -14
- package/src/override/Callback.component.tsx +0 -13
- package/src/override/Loading.component.tsx +0 -13
- package/src/override/ServiceWorkerNotSupported.component.tsx +0 -15
- package/src/override/SessionLost.component.tsx +0 -21
- package/src/override/style.ts +0 -10
- package/src/setupTests.js +0 -5
package/src/FetchUser.tsx
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import React, {useEffect, useState} from 'react';
|
|
2
|
-
|
|
3
|
-
import {useOidcFetch, withOidcFetch} from "./oidc/FetchToken";
|
|
4
|
-
import {OidcSecure} from "./oidc";
|
|
5
|
-
|
|
6
|
-
const DisplayUserInfo = ({ fetch }) => {
|
|
7
|
-
const [oidcUser, setOidcUser] = useState(null);
|
|
8
|
-
const [isLoading, setLoading] = useState(true);
|
|
9
|
-
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
const fetchUserInfoAsync = async () => {
|
|
12
|
-
const res = await fetch("https://demo.duendesoftware.com/connect/userinfo");
|
|
13
|
-
if (res.status != 200) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
return res.json();
|
|
17
|
-
};
|
|
18
|
-
let isMounted = true;
|
|
19
|
-
fetchUserInfoAsync().then((userInfo) => {
|
|
20
|
-
if(isMounted) {
|
|
21
|
-
setLoading(false);
|
|
22
|
-
setOidcUser(userInfo)
|
|
23
|
-
}
|
|
24
|
-
})
|
|
25
|
-
return () => {
|
|
26
|
-
isMounted = false;
|
|
27
|
-
};
|
|
28
|
-
},[]);
|
|
29
|
-
|
|
30
|
-
if(isLoading){
|
|
31
|
-
return <>Loading</>;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<div className="container mt-3">
|
|
36
|
-
<div className="card text-white bg-success mb-3">
|
|
37
|
-
<div className="card-body">
|
|
38
|
-
<h5 className="card-title">User information</h5>
|
|
39
|
-
{oidcUser != null && <p className="card-text">{JSON.stringify(oidcUser)}</p>}
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
)
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const UserInfoWithFetchHoc = withOidcFetch(fetch)(DisplayUserInfo);
|
|
47
|
-
|
|
48
|
-
export const FetchUserHoc= () => <OidcSecure><UserInfoWithFetchHoc/></OidcSecure>;
|
|
49
|
-
|
|
50
|
-
export const FetchUserHook= () => {
|
|
51
|
-
const {fetch} = useOidcFetch();
|
|
52
|
-
return <OidcSecure><DisplayUserInfo fetch={fetch} /></OidcSecure>
|
|
53
|
-
}
|
package/src/Home.tsx
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {useOidc} from "./oidc";
|
|
3
|
-
|
|
4
|
-
export const Home = () => {
|
|
5
|
-
|
|
6
|
-
const { login, logout, isAuthenticated} = useOidc();
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<div className="container-fluid mt-3">
|
|
10
|
-
<div className="card">
|
|
11
|
-
<div className="card-body">
|
|
12
|
-
<h5 className="card-title">Home</h5>
|
|
13
|
-
<p className="card-text">React Demo Application protected by OpenId Connect. More info on about oidc on <a href="https://github.com/AxaGuilDEv/react-oidc">GitHub @axa-fr/react-oidc</a></p>
|
|
14
|
-
{!isAuthenticated && <p><button type="button" className="btn btn-primary" onClick={() => login('/profile')}>Login</button></p>}
|
|
15
|
-
{!isAuthenticated && <p><button type="button" className="btn btn-primary" onClick={() => login('/profile', null, "youhou")}>Login with state</button></p>}
|
|
16
|
-
{isAuthenticated && <p><button type="button" className="btn btn-primary" onClick={() => logout('/profile')}>logout /profile</button></p>}
|
|
17
|
-
{isAuthenticated && <p><button type="button" className="btn btn-primary" onClick={() => logout('')}>logout</button></p>}
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
21
|
-
)
|
|
22
|
-
};
|
package/src/MultiAuth.tsx
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import React, {useState} from 'react';
|
|
2
|
-
import {OidcProvider, useOidc, useOidcAccessToken, useOidcIdToken} from "./oidc";
|
|
3
|
-
import { configurationIdentityServer, configurationIdentityServerWithHash, configurationGoogle} from "./configurations";
|
|
4
|
-
import AuthenticatingError from "./override/AuthenticateError.component"
|
|
5
|
-
import Authenticating from "./override/Authenticating.component"
|
|
6
|
-
import Loading from "./override/Loading.component"
|
|
7
|
-
import {CallBackSuccess} from "./override/Callback.component"
|
|
8
|
-
import SessionLost from "./override/SessionLost.component"
|
|
9
|
-
import ServiceWorkerNotSupported from "./override/ServiceWorkerNotSupported.component"
|
|
10
|
-
|
|
11
|
-
const MultiAuth = ( {configurationName, handleConfigurationChange }) => {
|
|
12
|
-
const { login, logout, isAuthenticated} = useOidc(configurationName);
|
|
13
|
-
const [fname, setFname] = useState("")
|
|
14
|
-
|
|
15
|
-
const handleChange = e => {
|
|
16
|
-
setFname(e.target.value)
|
|
17
|
-
}
|
|
18
|
-
return (
|
|
19
|
-
<div className="container-fluid mt-3">
|
|
20
|
-
<div className="card">
|
|
21
|
-
<div className="card-body">
|
|
22
|
-
<h5 className="card-title">Multiple Authentication</h5>
|
|
23
|
-
<form>
|
|
24
|
-
<label>
|
|
25
|
-
First Name:{" "}
|
|
26
|
-
<input type="text" value={fname} onChange={handleChange} />
|
|
27
|
-
</label>
|
|
28
|
-
</form>
|
|
29
|
-
<p className="card-text">React Demo Application protected by OpenId Connect with MultipleAuthentication.
|
|
30
|
-
<br/>For example, config_1 can have other sensitive scope, config_2 does not ask for the "offline_access" so it does not retrieve the most sensitive token "refresh_token" for very sensitive operation, it retrive only access_token valid for a small amout of time.</p>
|
|
31
|
-
<select value={configurationName} onChange={handleConfigurationChange} >
|
|
32
|
-
<option value="config_classic">config_classic</option>
|
|
33
|
-
<option value="config_without_refresh_token">config_without_refresh_token</option>
|
|
34
|
-
<option value="config_google">google</option>
|
|
35
|
-
<option value="config_with_hash">config_with_hash</option>
|
|
36
|
-
</select>
|
|
37
|
-
{!isAuthenticated && <button type="button" className="btn btn-primary" onClick={() => login()}>Login</button>}
|
|
38
|
-
{isAuthenticated && <button type="button" className="btn btn-primary" onClick={() => logout()}>logout</button>}
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
if(!sessionStorage.configurationName){
|
|
46
|
-
sessionStorage.configurationName = "config_classic";
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export const MultiAuthContainer = () => {
|
|
50
|
-
const [isSessionLost, setIsSessionLost] = useState(false)
|
|
51
|
-
const [configurationName, setConfigurationName] = useState(sessionStorage.configurationName);
|
|
52
|
-
const callBack = window.location.origin+"/multi-auth/authentification/callback2";
|
|
53
|
-
const silent_redirect_uri = window.location.origin+"/multi-auth/authentification/silent-callback2";
|
|
54
|
-
const configurations = {
|
|
55
|
-
config_classic: {...configurationIdentityServer,
|
|
56
|
-
redirect_uri:callBack,
|
|
57
|
-
silent_redirect_uri,
|
|
58
|
-
scope: 'openid profile email api offline_access'
|
|
59
|
-
},
|
|
60
|
-
config_without_refresh_token: {...configurationIdentityServer,
|
|
61
|
-
redirect_uri:callBack,
|
|
62
|
-
silent_redirect_uri: "",
|
|
63
|
-
scope: 'openid profile email api'},
|
|
64
|
-
config_google: { ...configurationGoogle },
|
|
65
|
-
config_with_hash: { ...configurationIdentityServerWithHash}
|
|
66
|
-
}
|
|
67
|
-
const handleConfigurationChange = (event) => {
|
|
68
|
-
const configurationName = event.target.value;
|
|
69
|
-
sessionStorage.configurationName = configurationName;
|
|
70
|
-
setConfigurationName(configurationName);
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const onSessionLost = ()=>{
|
|
75
|
-
setIsSessionLost(true);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return (
|
|
79
|
-
<>
|
|
80
|
-
<OidcProvider configuration={configurations[configurationName]}
|
|
81
|
-
configurationName={configurationName}
|
|
82
|
-
loadingComponent={Loading}
|
|
83
|
-
authenticatingErrorComponent={AuthenticatingError}
|
|
84
|
-
authenticatingComponent={Authenticating}
|
|
85
|
-
serviceWorkerNotSupportedComponent={ServiceWorkerNotSupported}
|
|
86
|
-
callbackSuccessComponent={CallBackSuccess}
|
|
87
|
-
onSessionLost={onSessionLost}
|
|
88
|
-
>
|
|
89
|
-
{ isSessionLost && <SessionLost configurationName={configurationName}/>}
|
|
90
|
-
<MultiAuth configurationName={configurationName} handleConfigurationChange={handleConfigurationChange} />
|
|
91
|
-
<DisplayAccessToken configurationName={configurationName} />
|
|
92
|
-
</OidcProvider>
|
|
93
|
-
</>
|
|
94
|
-
);
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
const DisplayAccessToken = ({configurationName}) => {
|
|
98
|
-
const{ accessToken, accessTokenPayload } = useOidcAccessToken(configurationName);
|
|
99
|
-
const{ idTokenPayload } = useOidcIdToken(configurationName);
|
|
100
|
-
|
|
101
|
-
if(!accessToken){
|
|
102
|
-
return <p>you are not authentified</p>
|
|
103
|
-
}
|
|
104
|
-
return (
|
|
105
|
-
<div className="card text-white bg-info mb-3">
|
|
106
|
-
<div className="card-body">
|
|
107
|
-
<h5 className="card-title">Access Token</h5>
|
|
108
|
-
<p style={{color:'red', "backgroundColor": 'white'}}>Please consider to configure the ServiceWorker in order to protect your application from XSRF attacks. "access_token" and "refresh_token" will never be accessible from your client side javascript.</p>
|
|
109
|
-
{<p className="card-text">Access Token: {JSON.stringify(accessToken)}</p>}
|
|
110
|
-
{accessTokenPayload != null && <p className="card-text">Access Token Payload: {JSON.stringify(accessTokenPayload)}</p>}
|
|
111
|
-
<h5 className="card-title">Id Token</h5>
|
|
112
|
-
{idTokenPayload != null && <p className="card-text">Access Token Payload: {JSON.stringify(idTokenPayload)}</p>}
|
|
113
|
-
</div>
|
|
114
|
-
</div>
|
|
115
|
-
)
|
|
116
|
-
};
|
package/src/Profile.tsx
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import {OidcSecure, useOidcAccessToken, useOidcIdToken, useOidcUser, OidcUserStatus} from "./oidc";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const DisplayUserInfo = () => {
|
|
7
|
-
const{ oidcUser, oidcUserLoadingState } = useOidcUser();
|
|
8
|
-
|
|
9
|
-
switch (oidcUserLoadingState){
|
|
10
|
-
case OidcUserStatus.Loading:
|
|
11
|
-
return <p>User Information are loading</p>;
|
|
12
|
-
case OidcUserStatus.Unauthenticated:
|
|
13
|
-
return <p>you are not authenticated</p>;
|
|
14
|
-
case OidcUserStatus.LoadingError:
|
|
15
|
-
return <p>Fail to load user information</p>;
|
|
16
|
-
default:
|
|
17
|
-
return (
|
|
18
|
-
<div className="card text-white bg-success mb-3">
|
|
19
|
-
<div className="card-body">
|
|
20
|
-
<h5 className="card-title">User information</h5>
|
|
21
|
-
<p className="card-text">{JSON.stringify(oidcUser)}</p>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const Profile = () => {
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<div className="container mt-3">
|
|
32
|
-
<DisplayAccessToken/>
|
|
33
|
-
<DisplayIdToken/>
|
|
34
|
-
<DisplayUserInfo/>
|
|
35
|
-
</div>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const DisplayAccessToken = () => {
|
|
40
|
-
const{ accessToken, accessTokenPayload } = useOidcAccessToken();
|
|
41
|
-
|
|
42
|
-
if(!accessToken){
|
|
43
|
-
return <p>you are not authenticated</p>
|
|
44
|
-
}
|
|
45
|
-
return (
|
|
46
|
-
<div className="card text-white bg-info mb-3">
|
|
47
|
-
<div className="card-body">
|
|
48
|
-
<h5 className="card-title">Access Token</h5>
|
|
49
|
-
<p style={{color:'red', "backgroundColor": 'white'}}>Please consider to configure the ServiceWorker in order to protect your application from XSRF attacks. "access_token" and "refresh_token" will never be accessible from your client side javascript.</p>
|
|
50
|
-
{<p className="card-text">Access Token: {JSON.stringify(accessToken)}</p>}
|
|
51
|
-
{accessTokenPayload != null && <p className="card-text">Access Token Payload: {JSON.stringify(accessTokenPayload)}</p>}
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
)
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const DisplayIdToken =() => {
|
|
59
|
-
const{ idToken, idTokenPayload } = useOidcIdToken();
|
|
60
|
-
|
|
61
|
-
if(!idToken){
|
|
62
|
-
return <p>you are not authenticated</p>
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<div className="card text-white bg-info mb-3">
|
|
67
|
-
<div className="card-body">
|
|
68
|
-
<h5 className="card-title">ID Token</h5>
|
|
69
|
-
{<p className="card-text">IdToken: {JSON.stringify(idToken)}</p>}
|
|
70
|
-
{idTokenPayload != null && <p className="card-text">IdToken Payload: {JSON.stringify(idTokenPayload)}</p>}
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
export const SecureProfile = () => <OidcSecure><Profile /></OidcSecure>;
|
package/src/configurations.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
export const configurationIdentityServer = {
|
|
2
|
-
client_id: 'interactive.public.short',
|
|
3
|
-
redirect_uri: window.location.origin+'/authentication/callback',
|
|
4
|
-
silent_redirect_uri: window.location.origin+'/authentication/silent-callback',
|
|
5
|
-
silent_signin_uri: window.location.origin+'/authentication/silent-sign-in',
|
|
6
|
-
scope: 'openid profile email api offline_access',
|
|
7
|
-
authority: 'https://demo.duendesoftware.com',
|
|
8
|
-
//authority_time_cache_wellknowurl_in_second: 60* 60,
|
|
9
|
-
refresh_time_before_tokens_expiration_in_second: 280,
|
|
10
|
-
service_worker_relative_url:'/OidcServiceWorker.js',
|
|
11
|
-
service_worker_only: false,
|
|
12
|
-
//storage: localStorage,
|
|
13
|
-
//silent_signin_timeout: 3333000
|
|
14
|
-
monitor_session:true,
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const configurationIdentityServerWithHash = {
|
|
18
|
-
client_id: 'interactive.public.short',
|
|
19
|
-
redirect_uri: window.location.origin+'/multi-auth/authentification#authentication-callback',
|
|
20
|
-
silent_redirect_uri: window.location.origin+'/multi-auth/authentification#authentication-silent-callback',
|
|
21
|
-
silent_signin_uri: window.location.origin+'#authentication-silent-signin',
|
|
22
|
-
scope: 'openid profile email api offline_access',
|
|
23
|
-
authority: 'https://demo.duendesoftware.com',
|
|
24
|
-
refresh_time_before_tokens_expiration_in_second: 70,
|
|
25
|
-
service_worker_relative_url:'/OidcServiceWorker.js',
|
|
26
|
-
service_worker_only: false,
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const configurationIdentityServerWithoutDiscovery = {
|
|
30
|
-
client_id: 'interactive.public.short',
|
|
31
|
-
redirect_uri: window.location.origin+'/authentication/callback',
|
|
32
|
-
silent_redirect_uri: window.location.origin+'/authentication/silent-callback',
|
|
33
|
-
silent_signin_uri: window.location.origin+'/authentication/silent-sign-in',
|
|
34
|
-
scope: 'openid profile email api offline_access',
|
|
35
|
-
authority: 'https://demo.duendesoftware.com',
|
|
36
|
-
authority_configuration: {
|
|
37
|
-
authorization_endpoint: 'https://demo.duendesoftware.com/connect/authorize',
|
|
38
|
-
token_endpoint: 'https://demo.duendesoftware.com/connect/token',
|
|
39
|
-
userinfo_endpoint: 'https://demo.duendesoftware.com/connect/userinfo',
|
|
40
|
-
end_session_endpoint: 'https://demo.duendesoftware.com/connect/endsession',
|
|
41
|
-
revocation_endpoint: 'https://demo.duendesoftware.com/connect/revocation',
|
|
42
|
-
},
|
|
43
|
-
refresh_time_before_tokens_expiration_in_second: 70,
|
|
44
|
-
service_worker_relative_url:'/OidcServiceWorker.js',
|
|
45
|
-
service_worker_only: false,
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export const configurationAuth0 = {
|
|
49
|
-
client_id: 'xGZxEAJhzlkuQUlWl90y1ntIX-0UDWHx',
|
|
50
|
-
redirect_uri: window.location.origin+'/callback',
|
|
51
|
-
scope: 'openid profile email api offline_access',
|
|
52
|
-
authority: 'https://kdhttps.auth0.com',
|
|
53
|
-
refresh_time_before_tokens_expiration_in_second: 70,
|
|
54
|
-
service_worker_relative_url:'/OidcServiceWorker.js',
|
|
55
|
-
service_worker_only: false,
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export const configurationGoogle = {
|
|
59
|
-
client_id: '908893276222-f2drloh56ll0g99md38lv2k810d0nk0p.apps.googleusercontent.com',
|
|
60
|
-
redirect_uri: `${window.location.origin}/multi-auth/callback-google`,
|
|
61
|
-
silent_redirect_uri: window.location.origin+'/multi-auth/silent-callback-google',
|
|
62
|
-
silent_signin_uri: window.location.origin+'/multi-auth/silent-signin-google',
|
|
63
|
-
scope: 'openid profile email',
|
|
64
|
-
authority: 'https://accounts.google.com/',
|
|
65
|
-
service_worker_relative_url:'/OidcServiceWorker.js',
|
|
66
|
-
service_worker_only: false,
|
|
67
|
-
token_request_extras: {
|
|
68
|
-
client_secret : "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"
|
|
69
|
-
}
|
|
70
|
-
};
|
package/src/index.css
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
body {
|
|
2
|
-
margin: 0;
|
|
3
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
|
4
|
-
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
|
5
|
-
sans-serif;
|
|
6
|
-
-webkit-font-smoothing: antialiased;
|
|
7
|
-
-moz-osx-font-smoothing: grayscale;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
code {
|
|
11
|
-
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
|
12
|
-
monospace;
|
|
13
|
-
}
|
package/src/index.tsx
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { createRoot } from 'react-dom/client';
|
|
3
|
-
import './index.css';
|
|
4
|
-
import App from './App';
|
|
5
|
-
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
6
|
-
|
|
7
|
-
const container = document.getElementById('root');
|
|
8
|
-
const root = createRoot(container); // createRoot(container!) if you use TypeScript
|
|
9
|
-
root.render(<React.StrictMode><App/></React.StrictMode>);
|
package/src/logo.svg
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
|
|
2
|
-
<g fill="#61DAFB">
|
|
3
|
-
<path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/>
|
|
4
|
-
<circle cx="420.9" cy="296.5" r="45.7"/>
|
|
5
|
-
<path d="M520.5 78.1z"/>
|
|
6
|
-
</g>
|
|
7
|
-
</svg>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import {ComponentType} from "react";
|
|
3
|
-
import {style} from "./style";
|
|
4
|
-
|
|
5
|
-
const AuthenticatingError: ComponentType<any> = ({configurationName}) => (
|
|
6
|
-
<div className="oidc-authenticating" style={style}>
|
|
7
|
-
<div className="oidc-authenticating__container">
|
|
8
|
-
<h1 className="oidc-authenticating__title">Error authentication for {configurationName}</h1>
|
|
9
|
-
<p className="oidc-authenticating__content">An error occurred during authentication.</p>
|
|
10
|
-
</div>
|
|
11
|
-
</div>
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
export default AuthenticatingError;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import {PropsWithChildren} from "react";
|
|
3
|
-
import {style} from "./style";
|
|
4
|
-
|
|
5
|
-
const Authenticating : PropsWithChildren<any> = ({configurationName}) => (
|
|
6
|
-
<div className="oidc-authenticating" style={style}>
|
|
7
|
-
<div className="oidc-authenticating__container">
|
|
8
|
-
<h1 className="oidc-authenticating__title">Authentication in progress for {configurationName}</h1>
|
|
9
|
-
<p className="oidc-authenticating__content">You will be redirected to the login page.</p>
|
|
10
|
-
</div>
|
|
11
|
-
</div>
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
export default Authenticating;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React, {ComponentType} from 'react';
|
|
2
|
-
import {style} from "./style";
|
|
3
|
-
|
|
4
|
-
export const CallBackSuccess: ComponentType<any> = ({configurationName}) => (<><div className="oidc-callback" style={style}>
|
|
5
|
-
<div className="oidc-callback__container">
|
|
6
|
-
<h1 className="oidc-callback__title">Authentication complete for {configurationName}</h1>
|
|
7
|
-
<p className="oidc-callback__content">You will be redirected to your application.</p>
|
|
8
|
-
</div>
|
|
9
|
-
</div>
|
|
10
|
-
<div>
|
|
11
|
-
</div>
|
|
12
|
-
</>
|
|
13
|
-
);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import {ComponentType } from "react";
|
|
3
|
-
import {style} from "./style";
|
|
4
|
-
|
|
5
|
-
const Loading : ComponentType<any> = ({children, configurationName}) => (
|
|
6
|
-
<>
|
|
7
|
-
<span className="oidc-loading" style={style}>
|
|
8
|
-
Loading for {configurationName}
|
|
9
|
-
</span>
|
|
10
|
-
</>
|
|
11
|
-
);
|
|
12
|
-
|
|
13
|
-
export default Loading;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import {ComponentType} from "react";
|
|
3
|
-
import {style} from "./style";
|
|
4
|
-
|
|
5
|
-
const ServiceWorkerNotSupported : ComponentType<any> = ({configurationName}) => (
|
|
6
|
-
<><div className="oidc-serviceworker" style={style}>
|
|
7
|
-
<div className="oidc-serviceworker__container">
|
|
8
|
-
<h1 className="oidc-serviceworker__title">Unable to authenticate on this browser for {configurationName}</h1>
|
|
9
|
-
<p className="oidc-serviceworker__content">Your browser is not secure enough to make authentication work. Try updating your browser or use a newer browser.</p>
|
|
10
|
-
</div>
|
|
11
|
-
</div>
|
|
12
|
-
</>
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
export default ServiceWorkerNotSupported;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React, {ComponentType} from 'react';
|
|
2
|
-
import {style} from "./style"
|
|
3
|
-
import {useOidc} from "../oidc";
|
|
4
|
-
|
|
5
|
-
export const SessionLost: ComponentType<any> = ({configurationName}) => {
|
|
6
|
-
const { login} = useOidc(configurationName);
|
|
7
|
-
|
|
8
|
-
return (<>
|
|
9
|
-
<div className="oidc-session-lost" style={style}>
|
|
10
|
-
<div className="oidc-session-lost__container">
|
|
11
|
-
<h1 className="oidc-session-lost__title">Session timed out for {configurationName}</h1>
|
|
12
|
-
<p className="oidc-session-lost__content">
|
|
13
|
-
Your session has expired. Please re-authenticate.
|
|
14
|
-
</p>
|
|
15
|
-
<button type="button" className="btn btn-primary" onClick={() => login(null)}>Login</button>
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
</>)
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default SessionLost;
|
package/src/override/style.ts
DELETED
package/src/setupTests.js
DELETED