Skip to content

Setting authorize_params resource to https://outlook.office365.com/ breaks auth #6

@kaspth

Description

@kaspth

Hi @simi! I've been using your gem to integrate our app with office 365, and I really appreciate the work you're doing maintaining this ❤️

I have a small niggle though. In our app we want to access tokens for the Mail, Contacts and Calendar API at https://outlook.office365.com/ - mostly for https://outlook.office365.com/api/v1.0/me/messages - which means we have to pass that as the resource (otherwise we'll get tokens we can't use).
However, that breaks raw_info because there's no API at https://outlook.office365.com/Me?api_version=1.5. When raw_info breaks it takes the rest of the auth with it and all we get is an obtuse OAuth2::Error with no message.

I've fixed this in my app by switching raw_info back to what it was in your initial commit. Then I can pass option :authorize_params, resource: 'https://outlook.office365.com/' just fine and everything works.

I don't know exactly how to fix this here. But I'd definitely wish for more documentation (which I'll gladly help out with if you want).

Thanks again ❤️

Another point that I'd love to have documented is that the resource must end with a slash, otherwise raw_info is again broken because it will create a URL like .comMe?api_version=1.5, which you get an equally obtuse error from Net::HTTP for.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions