Forum Discussion
graph toolkit SSO without Login Component
in my teams tab i have followed the below link and authenticated Teams Tab.
https://docs.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/authentication/auth-aad-sso
I want to able to use graph tool kit with out Login component as i have sso for tab,
is it possible to do so? if so can i call the graph toolkit components
- HunaidHanfee-MSFTMicrosoft
Umag98 - Hello,
Have a look at Microsoft Graph Toolkit providers. You can use Custom provider - Microsoft Graph | Microsoft Docs. Let me know if you need any help.Thanks,
Hunaid Hanfee
--------------------------------------------------------------------------------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.
- Umag98Brass Contributor
I tried using the simple provider.
it is not working as expected.provider = new SimpleProvider(async function getAccessTokenhandler(scopes: string[]) {try {let _accessToken = localStorage.getItem("accessToken");if (_accessToken) {return _accessToken;}} catch (error) {console.log(error);return error;}});Providers.globalProvider = provider;Providers.globalProvider.setState(ProviderState.SignedIn);and i am trying to call the People picker<div>{gotAccessToken && <div><PeoplePicker {...props.pickerType === "person" ? { type: PersonType.person } :{ ...props.pickerType === "group" ? { type: PersonType.group } : { type: PersonType.any } }} {...props.isPickerDisabled ? { disabled: true } : undefined}defaultSelectedUserIds={defaultPickerValue} selectionMode={props.selectionMode} selectionChanged={handleSelectionChanged} />{props.toShowSelectedPeople && <div>Selected People: <People people={people} /></div>}</div>}{!gotAccessToken && <Spinner label="Loading..." ariaLive="assertive" labelPosition="left" />}</div>The accessToken i am getting from the asp.net web api,with which i am able to call graph apis. in the asp.net core webapi.
i am using the same here, but it is not working.this is the error I get when i try to do it- error: {code: "InvalidAuthenticationToken", message: "Access token validation failure. Invalid audience.",…}
- code: "InvalidAuthenticationToken"
- innerError: {date: "2021-08-24T08:27:14", request-id: "494c6420-fedc-4314-b71f-2f8e188a38c1",…}
- message: "Access token validation failure. Invalid audience."
- ChetanSharma-msftMicrosoftUmag98 - Looks like your configuration is wrong for token validation "audience".
Could you please reverify & test it again.