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...
Umag98
Aug 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.
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-msft
Microsoft
Aug 26, 2021Umag98 - Looks like your configuration is wrong for token validation "audience".
Could you please reverify & test it again.
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 ?- HunaidHanfee-MSFTAug 27, 2021Iron Contributor
Umag98 : Hello I have tried this with access token I got following this doc: Get access without a user
I tested with the snippet you shared and it worked fine. Could you please tell the endpoint you are using to get access token? Also, it would be better if you can share the whole request(by hiding the private information). Please go through this question to understand more about the error you got :
Access token validation failure. Invalid audience. - Microsoft Q&A- Umag98Aug 27, 2021Brass Contributorour endpoin is :https://login.microsoftonline.com/{0}/oauth2/token
{ "client_id", },
{ "client_secret", },
{ "scope", },
{ "resource", },
{ "grant_type", },
{ "requested_token_use", },
{ "assertion", }