Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 2697 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

I'm trying to get a token from an authorization server using cURL in Insert From URL. When I make the following request in Terminal

curl -i -X POST -d 'username=myaccountname&password=mypassword' https://authserver.com/login

I get the token back in the response header.

Since FileMaker doesn't support the --include (-i) option I haven't been able to figure out how to get the response header with the token.  Anyone have any ideas on how to accomplish this?

Thanks in advance!

-Kent

UPDATE:

Okay, I figured out I can get a response header by using the option --dump-header and setting it to a variable. The only problem now is that the token comes from a redirect location and I'm only getting the response header from the original URL. I'll keep working on it but I'll be happy to get whatever advice anyone can offer in the meantime. 

Edited by Kent Searight
Posted (edited)

Never mind. I got it to work with the following cURL options.

-L -d 'username=myaccountname&password=mypassword' --cookie-jar $cookies

I'm curious though if anyone knows why FMI chose not to support the --include option. 

Edited by Kent Searight
  • 2 weeks later...
  • Newbies
Posted

How did you get response header with dump-header?

Posted
7 hours ago, Wang said:

How did you get response header with dump-header?

Turned out I didn't need the headers. The result of --cookie-jar was all I needed. But if I'd wanted the headers too all I'd need to do is follow that option with a variable and it would write to that. Example: --dump-header $myVariable. 

This topic is 2697 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

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

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.