Forum Discussion
Umag98
Jul 23, 2021Brass Contributor
graph toolkit SSO without Login Component
in my teams tab i have followed the below link and authenticated Teams Tab. http://teams%20tab sso I want to able to use graph tool kit with out Login component as i have sso for tab, is it possi...
HunaidHanfee-MSFT
Jul 30, 2021Iron Contributor
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.
- Umag98Aug 24, 2021Brass 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-msftAug 26, 2021
Microsoft
Umag98 - Looks like your configuration is wrong for token validation "audience".
Could you please reverify & test it again.- Umag98Aug 26, 2021Brass Contributor
ChetanSharma-msft '
As I already have a accessToken, i can pass that right, or should i pass the assertion token from the teams ?