2

I am trying to authenticate in my app using oauth 2.0 with custom redirect_uri

https://url&redirect_uri=com.A.B.C://redirect

It works fine on most of the Android phones. However, on few Android phones like OnePlus2, LG K8 V I am getting following exception while making HttpUrlConnection.

MalformedUrlException: Unknown Protocol: com.A.B.C

How should it be handled in these devices ?

2 Answers 2

1

The problem with the uri I can see is the custom protocol you are passing with the redirect_uri parameter.

Should be like : https://url&redirect_uri=customProtocol://redirect

Hope it helps

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the reply. Same works in other Android devices. Same url.
1

Without additional information it's hard to say what's wrong. However, under the assumption this is actually a URI parser bug on said devices you could try a workaround like encoding the colon character (as %3A) like so:

https://example.com?redirect_uri=com.my.scheme%3A//redirect

That could help to avoid these parsers to misread the URI.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.