-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No interfaces for authentication responses #69
Comments
@luzlab I couldn't get it, you explain the scenario more elaborately ? |
When I get an [access token from the identity platform endpoint, I couldn't find a Typescript definition for the response. It's minor, In my code, I used an inline type assertion to handle this. const options = {
form: payload,
json: true,
method: 'POST',
uri: `https://login.microsoftonline.com/${tenantId}/oauth2/v2.0/token`,
};
const { access_token, expires_in } =(await request(options)) as { access_token: String; expires_in: Number }; I was thinking that it would be easy to add a type for the response... enum TokenType {
bearer,
}
interface Authorization {
token_type: TokenType
expires_in: number
access_token: string
}
// ... so I could do this instead
const { access_token, expires_in } =(await request(options)) as MicrosoftGraph.Authorization |
I would also like this, but I was under the impression that the OAuth API is separate from the Graph API, no? |
I would also find this useful. Authorization is part of the flow in consuming the Graph API and the token is used in subsequent calls. |
if you are using msal as the ImplicitMSALAuthenticationProvider in the javascript SDK does, it does provide an AuthResponse interface. this project is about describing responses from the Graph API, and while it is a part of the flow in the javascript SDK the SDK doesn't itself handle the authentication. |
I noticed there no interfaces for responses when authenticating into the Graph API. I could work on a PR if this isn't on the roadmap.
AB#7039
The text was updated successfully, but these errors were encountered: