Jump to content

302 Redirect and display of URI Query Component

Recommended Posts

Site URL: https://www.m2avc.com

Hi,

I'm working on an integration with a major Air Conditioning company and to authorize my app I need to have a redirect URL that will display the authorization code. They recommend PHP but I can't use PHP with Squarespace. Does anyone have any ideas of where I could begin to look for how to do something like this inside the Squarespace sandbox? The example response is below. It uses a 302 redirect with query components. I need to pull out just the code, format, and display it in a web page for the client to copy and paste into an app. In this example the code is 12A3456BCD789123. Thank you all in advance.

   HTTP/1.1 302 Found
   Location: yourApp://authCode?
   code=12A3456BCD789123&
   state=a1bcd2fgh3ijkLm4opQRST

 

Edited by M2AV
Clarification
Link to comment
  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi,

Does this authorization only apply to the client you're working with? Is the app intended will it be handling requests from consumers on Squarespace as well?

I'd probably try and handle resolving requests externally, server-side, and then serve your response to the destination where the request was made. If I understand this correctly, it would be on Squarespace so you could do this via an embed or iframe is something. 

 

 

Link to comment

So, when on Carrier's website, a user will input their cloud credentials and "Allow" my app to connect to their account. When they subm their info, Carrier will redirect to a URL of my choosing but I need to be able to display the code that's in the 302 redirect. The user will copy that and paste it into my app to grant access. 

Link to comment

Squarespace is a 'website builder', and whilst this means that you can produce a professional-looking website very easily without technical knowledge, it also means that you are unable to access backend code (like PHP) where something like this would need to be integrated.

Improve your online store with our extensions.
About: Squarespace Circle Leader since 2017. I value honesty, transparency, appreciation and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™.
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Buy me a coffee

Link to comment
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.