SPA プロジェクトの 1 つで、クライアントでoidc-client-jsを使用しています。私はIdentityServer4で書かれたアイデンティティサーバーを持っています。
サーバーの日時を手動で変更すると、日時が同じではないため、oidc-client-jsはログイン ユーザーのサーバーの応答を検証できません。
また、クライアントの日時を手動で変更し、サーバーを自動日時オプションで保持すると、サーバーからの応答が無効になります。
日時を操作するための JavaScript ソリューションは信頼性が低く、すべての日時をサーバーで検証する必要があると思います。
クライアントではなくサーバーでトークンを検証するにはどうすればよいですか?
私の仮定は正しいですか?それが正しくない場合、oidc-client-jsがブラウザー時間の代わりにサーバー時間を使用するための解決策はありますか?
これは私のクライアント構成です
const userManagerConfig = {
client_id: '58bdb6b3dd264200a1186573a8abf884',
redirect_uri: `${window.location.protocol}//${window.location.hostname}${window.location.port ? `:${window.location.port}` : ''}/authentication/callback`,
response_type: 'code',
post_logout_redirect_uri: `${window.location.protocol}//${window.location.hostname}${window.location.port ? `:${window.location.port}` : ''}`,
scope: 'openid profile phone tes.api',
authority: `http://localhost:5016`,
silent_redirect_uri: `${window.location.protocol}//${window.location.hostname}${window.location.port ? `:${window.location.port}` : ''}/authentication/silent_callback`,
automaticSilentRenew: true,
filterProtocolClaims: true,
loadUserInfo: true,
triggerAuthFlow : true
};