How can I do OpenId based authentication using Curl? At first place can I do it? Regards, Allahbaksh
相关问题
- Design RESTful service with multiple ids
- Axios OPTIONS instead of POST Request. Express Res
- Plain (non-HTML) error pages in REST api
- java client program to send digest authentication
- Google Apps Script: testing doPost() with cURL
相关文章
- Got ActiveRecord::AssociationTypeMismatch on model
- Multiple parameters in AngularJS $resource GET
- Global Exception Handling in Jersey & Spring?
- Programmatically scraping a response header within
- REST search interface and the idempotency of GET
- User.Identity.IsAuthenticated vs WebSecurity.IsAut
- Getting error detail from WCF REST
- SwiftUI - Vertical Centering Content inside Scroll
I suppose you are talking about the curl command line, not the library. I have not tried, but according to what I know of OpenID and curl, it should be possible. However, not fully automated. You'll have to "parse" the content of the identity provider and of the content provider login pages if you want to be realy restful and generic. If you know where you're going and don't mind to couple your service and client (no hateoas), you can first authenticate with the identity provider, e.g.:
and then post your OpenID to the content provider:
This suppose that the content provider is already authorised to use the identity provider. Then get your content:
Note that this approach is not restful, since I hard encoded the POST uris and fields in the code. To decouple the client and the server, the uris and field names must be extracted from responses. In a bash script, you can use
sed
for example.I think is should work, but if not, then you'll have to realy follow the redirects and extract URIs and forms, since some params can be passed in the redirect URIs or in hidden form fields.