java web直接登陆exe应用程序_快速入门:向 Java Web 应用添加 Microsoft 登录功能

您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

快速入门:向 Java Web 应用添加 Microsoft 登录功能Quickstart: Add sign-in with Microsoft to a Java web app

10/09/2019

本文内容

在本快速入门中,你将下载并运行一个代码示例,该示例演示 Java Web 应用程序如何让用户登录并调用 Microsoft Graph API。In this quickstart, you download and run a code sample that demonstrates how a Java web application can sign in users and call the Microsoft Graph API. 任何 Azure Active Directory (Azure AD) 组织的用户都可以登录到应用程序。Users from any Azure Active Directory (Azure AD) organization can sign in to the application.

先决条件Prerequisites

若要运行此示例,需要:To run this sample, you need:

注册并下载快速入门应用Register and download your quickstart app

可以通过两种方式来启动快速入门应用程序:“快速”(选项 1)和“手动”(选项 2)。There are two ways to start your quickstart application: express (option 1) and manual (option 2).

选项 1:注册并自动配置应用,然后下载代码示例Option 1: Register and automatically configure your app, and then download the code sample

输入应用程序的名称并选择“注册”。Enter a name for your application, and then select Register.

按照门户快速入门体验中的说明下载自动配置的应用程序代码。Follow the instructions in the portal's quickstart experience to download the automatically configured application code.

选项 2:注册并手动配置应用程序和代码示例Option 2: Register and manually configure your application and code sample

步骤 1:注册应用程序Step 1: Register your application

若要注册应用程序并手动向其中添加应用的注册信息,请执行以下步骤:To register your application and manually add the app's registration information to it, follow these steps:

如果有权访问多个租户,请使用顶部菜单中的“目录 + 订阅”筛选器

b1ddca1adf58337b2086e08caeb5c1a1.png

,选择要在其中注册应用程序的租户。

搜索并选择“Azure Active Directory” 。Search for and select Azure Active Directory.

在“管理”下,选择“应用注册”。Under Manage, select App registrations.

选择“新注册”。Select New registration.

输入应用程序的名称(例如 java-webapp) 。Enter a Name for your application, for example java-webapp. 应用的用户可能会看到此名称。Users of your app might see this name. 稍后可对其进行更改。You can change it later.

选择“注册”。Select Register.

在“概述”页面上,记下“应用程序(客户端) ID”和“目录(租户) ID” 。On the Overview page, note the Application (client) ID and the Directory (tenant) ID. 在后面的步骤中会用到这些值。You'll need these values later.

在“管理”下,选择“身份验证”。Under Manage, select Authentication.

选择“添加平台” > “Web” 。Select Add a platform > Web.

在“重定向 URI”部分中,输入 https://localhost:8443/msal4jsample/secure/aad。In the Redirect URIs section, enter https://localhost:8443/msal4jsample/secure/aad.

选择“配置” 。Select Configure.

在“Web”部分的“重定向 URI”下,输入 https://localhost:8443/msal4jsample/graph/me 作为第二个重定向 URI 。In the Web section, under Redirect URIs, enter https

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值