mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 12:45:52 +03:00
[GH-ISSUE #348] OAuth with Outlook fails as soon as you give permission #219
Labels
No labels
bug
cocoapod
duplicate
enhancement
feature-request
help wanted
help wanted
invalid
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/OAuthSwift#219
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MaikoHermans on GitHub (Mar 8, 2017).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/348
Description:
I'm currently trying use the outlook mail service to obtain contacts/appointments and mails. However I've stumbled upon a problem.
I created a
URL schemelike described in theirREADMEThen I created a Constants file which looks like this
I created an application for outlook on https://apps.dev.microsoft.com
generated my
keyandsecretand filled them in inside my application.I added the
mobile applicationplatform to my app. Which tells me to use theredirect URI urn:ietf:wg:oauth:2.0:oobSo my code to authorise looks like this
when I run the code I first get a screen to enter my mail/password. When I enter my mail it will redirect me to a different page/portal where I can enter my password. When I've entered my password it will show me the permissions screen.
as soon as I hit
yesit will give me an error saying "Safari cannot open the page because the address is invalid." I'm pretty sure this has to do with theredirect URIbut I'm not sure what to do to actually fix this.Could you possibly tell me where I might be going wrong with this?
EDIT:
I added
urn:ietf:wg:oauth:2.0:oobto my url scheme as well but this didn't change anything.I've also added
but it doesn't even get here.
OAuth Provider (Outlook):
OAuth Version:
OS (Please fill the version) :
Installation method:
Library version:
Xcode version:
8.0 (Swift 3.0)
8.0 (Swift 2.3)
7.3.1
other: (Please fill in the version you are using.)
objective c
@phimage commented on GitHub (Mar 8, 2017):
urn:ietf:wg:oauth:2.0:oob is not a valid url scheme and cannot be open by safari
there is no
://if you create the url scheme like readme say, use it.. oauthTestAll:// in your callbackurl
and if microsoft don't accept it, you must do something else (go to wiki, maybe https://github.com/OAuthSwift/OAuthSwift/wiki/API-with-only-HTTP-scheme-into-callback-URL could help )
@MaikoHermans commented on GitHub (Mar 9, 2017):
@phimage
microsoft only accepts
urn:ietf:wg:oauth:2.0:oobthat's a value they give you and you can't change.I tried to use the http route but the thing is that outlook redirects me to the specified url instantly when it opens up the login page.
I think outlook redirects to the correct login page based on your mail address. When it tries to redirect it will automatically open the redirect url. I'm not sure how to fix this.
@phimage commented on GitHub (Mar 9, 2017):
maybe you choose native app or mobile app instead of web app, that's why you can change the redirect uri (some other providers as some configuration like that)
for urn:ietf:wg:oauth:2.0:oob, in my previous post I put a link, maybe implementing web view delegate allow to manage this redirect uri, and call OAuthSwift.handle
please provide a link to the documentation, maybe some one can help
@phimage commented on GitHub (Jun 4, 2017):
I add one comment on this issue
let oauthOU = OAuth2Swift -> retain issue, the object oauthOU must be set as class var