問題タブ [windows-live-id]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
656 参照

live-sdk - Microsoft Live API - アクセス トークンが無効です

クライアント コードとサーバー コードを含む "Outlook.com でログイン" フローを実装しようとしています。フローは次のとおりです。

  1. クライアントからユーザーを次の場所にリダイレクトします。

https://login.live.com/oauth20_authorize.srf?client_id=< クライアント ID >&response_type=code&redirect_uri=< ログイン HTML ページ >&scope=openid+offline_access+profile+https:%2f%2foutlook.office.com%2fmail. send+https:%2f%2foutlook.office.com%2fcontacts.read+onedrive.readwrite

  1. コードを自分の html ページに戻し、それを MY Java サーバーに投稿します。

  2. サーバー側では、コードを使用して、 https ://login.live.com/oauth20_token.srf への POST 要求を使用して、アクセス トークンとリフレッシュ トークンを取得します 。

本文の次のパラメーター: client_id、redirect_uri、client_secret、grant_type="authorization_code"、および code=<前のステップのコード>。

access_token と refresh_tokem を受け取りましたが、有効期限は 1 時間です。

  1. まだサーバー上で、私は URL を呼び出します

https://apis.live.net/v5.0/me?access_token= <取得したアクセストークン>

エラー 401 が表示されます。

この流れは可能ですか?