<h2>OAuth:認証コード権限許可フローは、UI からのユーザーの介入を必要とし、プログラムで自動化することはできません。</h2><br/><div style="overflow-x:auto"><article><div ><h3 >Issue </h3><section><style type="text/css"><!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: block; max-width: ; width: auto; height: auto; } } </style> <div class="ns-kb-css-body-editor-container"> <ul style="list-style-position: inside;"><li>次のようなシナリオを考えてみましょう。 <ol style="list-style-position: inside; list-style-type: lower-alpha;"><li>外部アプリケーションが <strong> サードパーティ OAuth プロバイダー</strong>である。</li><li>インスタンスでサードパーティ OAuth プロバイダーレコードが定義されている。</li><li>OAuth プロバイダーレコードの <strong>Default 権限許可タイプが [認証コード] に設定</strong>されている。</li><li>A <strong>REST メッセージ</strong> は、認証タイプが OAuth 2.0 で定義され、OAuth プロファイルが b で定義されています。</li></ol> </li><li>REST メッセージのポイント d. で <span style="color: #ff0000;"><strong>OAuth トークンを取得</strong></span> UI アクションをクリックすると、サードパーティ OAuth プロバイダーに認証トークンが要求されます。これにより、ユーザー UI (ブラウザー) に対して <em>Request for Permission</em> ウィンドウが開きます。</li><li>この「<strong><em>アクセス許可の要求</em></strong><em>」</em><strong>ステップは、プログラムで自動化することはできません</strong>。</li></ul> </div></section></div><div ><h3 >Release</h3><section><style type="text/css"><!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: block; max-width: ; width: auto; height: auto; } } </style> <div class="ns-kb-css-body-editor-container"> <ul style="list-style-position: inside;"><li>すべてのリリース</li></ul> </div></section></div><div ><h3 >Cause</h3><section><style type="text/css"><!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: block; max-width: ; width: auto; height: auto; } } </style> <div class="ns-kb-css-body-editor-container"> <ul style="list-style-position: inside;"><li>これは <strong>予想される動作</strong>です。<strong>ユーザー権限は</strong><strong>インタラクティブ</strong>ユーザーの介入で提供する必要がありますが、これは意図的なものです。</li><li>ただし、上記の手順でアクセストークンとリフレッシュトークンを取得すると、リフレッシュトークンは有効期限が切れるまで ServiceNow によって自動的に使用され、必要に応じて新しいアクセストークンが取得されます。</li></ul> </div></section></div><div ><h3 >Resolution</h3><section><style type="text/css"><!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: block; max-width: ; width: auto; height: auto; } } </style> <div class="ns-kb-css-body-editor-container"> <ul style="list-style-position: inside;"><li>OAuth 提供の認証との <strong>非インタラクティブ</strong> 統合を要件とする場合、可能なアプローチ(サードパーティアプリケーションエンドポイントでサポートされている場合)は次のとおりです。 <ul style="list-style-position: inside;"><li><strong>クライアント認証情報の権限許可タイプ</strong></li><li><strong>JWT 権限許可タイプ</strong></li></ul> </li></ul> </div></section></div><div ><h3 >Related Links</h3><section><style type="text/css"><!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: block; max-width: ; width: auto; height: auto; } } </style> <div class="ns-kb-css-body-editor-container"> <ul style="list-style-position: inside;"><li>詳細については、次のドキュメントを参照してください。</li><li><a title="OAuth 2.0 認証コード権限許可フロー" href="https://docs.servicenow.com/csh?topicname=c_OAuthAuthorizationCodeFlow.html&version=latest" target="_blank" rel="noopener noreferrer">OAuth 2.0 認証コード権限許可フロー</a></li><li><a title="OAuth サードパーティプロバイダー:認証コード権限許可フロー:例" href="https://docs.servicenow.com/csh?topicname=c_OAuth2ProfileTutorialGoogle.html&version=latest" target="_blank" rel="noopener noreferrer">OAuth サードパーティプロバイダー:認証コード権限許可フロー:例</a></li><li><a title="認証コード権限許可フローとは" href="https://developer.okta.com/blog/2018/04/10/oauth-authorization-code-grant-type" target="_blank" rel="noopener noreferrer">認証コード権限許可フローとは</a></li><li><a title="OAuth 2.0 クライアント認証情報" href="https://docs.servicenow.com/csh?topicname=c_OAuthApplications.html&version=latest" target="_blank" rel="noopener noreferrer">OAuth 2.0 クライアント認証情報</a></li><li><a title="OAuth 2.0 JWT ベアラー権限許可タイプ" href="https://docs.servicenow.com/csh?topicname=JWT-Bearer-token-support.html&version=latest" target="_blank" rel="noopener noreferrer">OAuth 2.0 JWT ベアラー権限許可タイプ</a></li></ul> </div></section></div></article></div>