LoginSignup
2
1

More than 5 years have passed since last update.

Outlook OAuth 2.0 認証を使ったログイン手順

Posted at

概要

ローカル開発環境のサンプルWebアプリで、Outlook OAuth 2.0 認証して、Outlookのメール、カレンダーを取得できるようにすることがゴールの記事です。

ログイン手順

1. テストアカウント作成

Microsoft アカウントを以下URLから作成する

2. アプリ ID / クライアント IDの作成と設定

  1. https://apps.dev.microsoft.com/#/appList
  2. アプリの追加
    • スクリーンショット 2018-02-06 18.51.05.png
  3. Application生成 1.アプリケーション シークレット > 新しいパスワードを生成
    • 新しいパスワードを生成
    • パスワードをメモしておく
  4. プラットフォーム > プラットフォームの追加 > Web
  5. 権限の付与
    • 以下、カレンダー、メールについて権限を付与する
    • スクリーンショット 2018-02-06 19.00.33.png
  6. 保存する

2. サンプルソースのcloneと設定

以下、auth.propertiesファイルに上記、取得したアプリ IDとパスワードを設定する

$ git clone git@github.com:jasonjoh/java-tutorial.git
$ vi java-tutorial/src/main/resources/auth.properties
appId=YOUR_APP_ID_HERE
appPassword=YOUR_APP_PASSWORD_HERE
redirectUrl=http://localhost:8080/authorize.html

3.サンプルの起動とログイン

$ mvn -q jetty:run

スクリーンショット 2018-02-06 19.10.39.png

Click here to login をクリックするとOutlookに認証される。

参考記事

OAuth 2.0
OAuth 2.0 を使った認証のガイドライン
スコープとアクセス許可

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1