Microsoft Teams SSO 集成:SSO 窗口打开时出现错误
2400
我正在致力于将 Angular 应用程序集成到 Microsoft Teams 中,并使用 SSO 通过 Azure AD 对用户进行身份验证。但是,我遇到了似乎无法解决的问题。
应用程序托管:该应用程序托管在
https://www.myexampleapp.com/test
。
Azure AD 应用程序 ID URI:
api://www.myexampleapp.com/test/12345678-abcd-efgh-ijkl-9876543210
。
团队清单:
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.16/MicrosoftTeams.schema.json",
"manifestVersion": "1.16",
"version": "1.0.2",
"id": "12345678-abcd-efgh-ijkl-9876543210",
"packageName": "com.example.teams-tab-app",
"developer": {
"name": "Your Name",
"websiteUrl": "https://example.com",
"privacyUrl": "https://example.com",
"termsOfUseUrl": "https://example.com"
},
"name": {
"short": "Teams Tab App",
"full": "Teams Tab Application"
},
"description": {
"short": "A simple app",
"full": "This is a simple app built with Angular."
},
"staticTabs": [
{
"entityId": "exampleTab",
"name": "Example Tab",
"contentUrl": "https://www.myexampleapp.com/test",
"context": ["personalTab", "channelTab"],
"scopes": ["personal", "team"]
}
],
"permissions": ["identity", "messageTeamMembers"],
"validDomains": ["www.myexampleapp.com"],
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"accentColor": "#FF5733",
"webApplicationInfo": {
"id": "12345678-abcd-efgh-ijkl-9876543210",
"resource": "api://www.myexampleapp.com/test/12345678-abcd-efgh-ijkl-9876543210"
}
}
获取代币的角度代码:
async ngOnInit() {
microsoftTeams.initialize();
await this.getAuthToken();
}
async getAuthToken() {
try {
this.authToken = await microsoftTeams.authentication.getAuthToken();
console.log('Authentication token:', this.authToken);
} catch (error) {
console.error('Error retrieving token:', error);
}
}
API权限:
User.Read
Files.Read.All
Error: Error: ApiContractViolation {"Description":"Embedded browser flow resulted in 'invalid_client' with description '(pii)'","ErrorCode":"2400","Message":"The operation attempted is invalid."}
任何帮助或指导将不胜感激!
请参阅附图: