I'm trying to write an app that makes use of Microsoft's B2C authentication process. I got up to pretty much the last step where it returns the authentication token. The high level code I'm running is:
params = [
uri: "https://login.microsoftonline.com",
path: "/konnectkohler.onmicrosoft.com/B2C_1_SignInUp/api/CombinedSigninAndSignup/confirmed",
query: [
csrf_token: csrf,
tx: transId,
p: "B2C_1_SignInUp"
],
headers: [
"Cookie": cookiesFromJar(cookieJar)
]
]
httpGet(params) { resp ->
log.debug resp.status
log.debug resp.data
}
I get a org.apache.http.client.ClientProtocolException: null on line 169
First I don't know what the "null" is in reference to, but line 169 is the httpGet. My guess (because I can't see any details) is it doesn't like that MS returns a "weird" Location header like:
Location: msaldee521c5-2a72-4fcd-8c4d-a044e607ca8b://auth/?state=0B3B09A7-FF51-4C39-89E1-E15A1C96D059&code=TOKENINEEDHERE
Is it because of that header? Is there anyway to get more info than just ClientProtocolException? Is there anyway to make this kind of authentication work? Basically I don't want it to actually follow that redirect, I want to extract that token.
Anyone have any thoughts? I'd hate to have to hard code my oauth token in the app when Microsoft has a whole process around this to do it the right way. Can I even see if the location header is the cause of my error? The stack trace is at [org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.jav - Pastebin.com
@chuck.schwer @mike.maxwell any thoughts on how to debug something like this?
Yup, a bit more digging and I'm correct
org.apache.http.HttpException: msaldee521c5-2a72-4fcd-8c4d-a044e607ca8b protocol is not supported
Any way I can work around this from an app?