[aerogear-dev] REST Installation Registration - Authentication problem
Karel Piwko
kpiwko at redhat.com
Wed Mar 26 12:16:47 EDT 2014
On Wed, 26 Mar 2014 07:06:09 -0700 (PDT)
A577127 <antoine.matyja at worldline.com> wrote:
> Hey,
>
> I have an AeroGear UnifiedPush Server running on Windows 7. I registered my
> application and got the Application ID and Master secret. I added a variant
> for my Android app.
>
> Now I want to register the installation for my app on my device. I want to
> do this without having to change my application, so instead of using
> AeroGear SDK for Android, I want to register my app's token "manually" with
> the REST API provided by AeroGear.
>
> I read this tutorial (#Installation Registration) :
> http://aerogear.org/docs/specs/aerogear-server-push/
> <http://aerogear.org/docs/specs/aerogear-server-push/>
>
> Since I can't use curl on windows, I'm using "Postman", a chrome plugin to
> send custom HTTP requests. I had a few problems :
>
> - The URL https://SERVER:PORT/context/rest/registry/device doesn't respond
> to HTTPS. It does with HTTP. (same for all other rest urls)
You have to enable https connector on the server. You need to:
1/ have a keystore/truststore with certificate (either real cert or you can
create one on your own (you can actually use the one in integration-tests )
2/ you need to enable https on the server - here is how we do that using jboss
cli -
https://github.com/aerogear/aerogear-unifiedpush-server-integration-tests/blob/master/setup/enable_https.cli
3/ beware, by default https uses port 8443 instead of 8080
4/ if you are using own certificate, likely you'd need to alter Postman
configuration somehow (no experience here). We are using RESTAssured instead of
curl and it works fine.
>
> - I "translated" the curl command to POST parameters, but when I send it I
> get an authentication request, even though I already set the App ID and
> master secret in the header, in "Authorization" (I searched a little about
> it, the value is "AppID:MasterSecret" base64 encoded)
> I tryed to use the username/password from my AG UnifiedPush server, it
> didn't work, same for App ID/Master secret. After cancelling I get
> "Unauthorized Request" of course.
>
> Here's a screenshot of the HTTP POST request configuration :
> <http://aerogear-dev.1069024.n5.nabble.com/file/n7128/shot1.png>
> And the form I get when I send it :
> <http://aerogear-dev.1069024.n5.nabble.com/file/n7128/shot2.png>
>
> Thanks in advance,
>
>
>
> --
> View this message in context:
> http://aerogear-dev.1069024.n5.nabble.com/REST-Installation-Registration-Authentication-problem-tp7128.html
> Sent from the aerogear-dev mailing list archive at Nabble.com.
> _______________________________________________ aerogear-dev mailing list
> aerogear-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
More information about the aerogear-dev
mailing list