jsorge
jsorge

@aaronpk I'm implementing a Micropub endpoint on a Vapor site (written in Swift). According to the Indieweb.org documentation, the state parameter “can contain anything”. Does this mean a String or Int are perfectly acceptable?

|
Embed
Progress spinner
aaronpk
aaronpk

@jsorge Yep, tho technically query string parameters are not typed so it's all a string in the end. For more info you can look up the OAuth 2.0 usage of the state parameter, it's the same thing. The authorization server will return whatever you send as the value.

|
Embed
Progress spinner
jsorge
jsorge

@aaronpk Cool. With my Swift type I had to declare it as a type at the outset, so I just wrote up a custom decoder to check for a string, then an Int, and otherwise it will be nil. The Int gets coerced to a String if it’s there. Do you know of any good test suite I could run locally against my server?

|
Embed
Progress spinner
aaronpk
aaronpk

@jsorge Nothing comprehensive yet, but I did make one tricky test case so far: https://indieauth.rocks/client/state/ I'd recommend trying to log in to as many apps as you can find as well.

|
Embed
Progress spinner
jsorge
jsorge

@aaronpk Yeah, I was hoping I could debug stuff locally and not have to deploy for testing. But it's not exactly "live" code on my site that I'm using yet so it's low impact. Thanks!

|
Embed
Progress spinner
aaronpk
aaronpk

@jsorge ah yeah, well if you want, you can install Micropub.rocks locally, it isn't too difficult to set up. Might be a better long term plan to set up a tunnel so you can give your laptop a public web address tho. There are a few tools for that.

|
Embed
Progress spinner
jsorge
jsorge

@aaronpk Ooh this is great! I signed up for an ngrok account and now everything is magical!

|
Embed
Progress spinner