Setting up Server Side and Client Side for Google Cloud Messaging - tomcat7

I am trying to make 2 applications which uses Google Cloud Messaging.
My goal is to make a one application Android IBM Worklight which can receive Push notifications (CLIENT-SIDE) and another application a Tomcat Server Java Servlet (SERVER-SIDE).
However, I have absolutely no experience in using Google Cloud Messaging and it is my first time using Android IBM Worklight as client-side.
So I was hoping someone could point me in the right direction that I so could have 1st application using tomcat server sending the Push notifications (SERVER-SIDE) and another application using IBM Worklight as (CLIENT-SIDE) to receive the push notification.
I have been finding tutorials regarding this but I am stuck at implementation.
This tutorial link gave me an idea on how to do server side since i am using tomcat server. However the client-side is code is not what I am looking for since I am using IBM Worklight inside.
Another tutorial link show me how the push notification works at IBM Worklight for both client and server side. However, as mention earlier my server side is Tomcat server at Eclipse thus I think that I can't using this tutorial for server side.
As for client side, I think can use this tutorial since it is IBM Worklight however it is not using Google Cloud Messaging.
I would appreciate someone help me..Thanks :)

The second tutorial has the information you need. If you have your Worklight server set up on Tomcat, just follow the tutorial and deploy the push adapter to that server.

Related

How to configure SSL on Spring Boot - Angular app on EC2 instance

I can't get my backend to send data after switching to secure connection.
I was able to successfully configure SSL with ssl_mod on Apache web server that serves my Angular app on AWS Linux 2 instance, the site is secure - but my Spring Boot backend is not responding, it is not sending any data. When I additionally convert .crt and .key files to PK12 that Spring understands and I use it in Spring app - I get this error:
net::ERR_SSL_PROTOCOL_ERROR
I've tried using AWS Load Balancer, but same thing happens, frontend is loaded in secure environment, but backend is not sending any data even after I change backend calls from http to https://my-site.com. I've tried following documentation and added this to my backend app properties file:
server.tomcat.remoteip.remote-ip-header=x-forwarded-for
server.tomcat.remoteip.protocol-header=x-forwarded-proto
and security configuration upgraded with this:
http.requiresChannel().anyRequest().requiresSecure()...
but to no avail.
Lastly, I created a new instance on EC2 and this time I didn't configure apache for the frontend on linux, I just used SSL certificate on my backend app with following properties:
server.ssl.enabled=true
server.ssl.key-store=/etc/ssl/mydomain_com.p12
server.ssl.key-store-password=******
server.ssl.key-alias=mydomain
To no avail, now my site doesn't load at all. I'm despearate, struggling with this for a week now. What is the procedure for a full stack app? How do I do it?
Let me respond because on the same day I asked the question - I found a solution. The solution was - converting free SSL certificate with the help of this website:
https://www.sslshopper.com/ssl-converter.html
After I've plugged it in my Spring Boot app - it works. Before that, I made the conversion with OpenSSL on Windows, and it seems it was faulty. I'm so happy now... I read so many articles on this website on my one and a half year journey of learning to code - and got stuck on the last step. I'm so happy. Thank you all for this amazing website and all the help. I love you! I'm proud of being a part of this programming community... the best humor, the best people!
Peace

Unable to connect to Websocket from CloudRun

We have a backend developed with Golang using Fiber (gofiber) and used also Fiber's Websocket middleware.
When trying to connect from a Web client in local (ws://...) it works perfectly. When deploying our server to CloudRun, and trying to connect (ws://...) it returns a 400.
Any idea what I am missing?
WebSockets are currently not supported on Cloud Run fully managed. This is a highly requested feature, but it's not yet implemented.
However, running WebSockets currently works on Cloud Run for Anthos because of its GCE-based native networking layer.

IBM ICN cross application authentication

We currently have an installation of IBM content navigator that we built a feature inside, this feature shows another web application installed on the same server inside an iFrame, this application connects to CPE using Java WS APIs to do some operations using the ICN logged in user credentials.
The main problem we are facing is that in our current solution the user logs in twice, once to log in to the ICN, and another to log in to the web application, which is undesirable and we need to eliminate this second login and implement some sort of SSO.
One option available is using Kerberos, however as it currently stands the FileNet Java api does not support Kerberos at the moment (only .Net).
Any ideas are much appreciated
References
Using Kerberos on an API Client - https://www.ibm.com/support/knowledgecenter/SSGLW6_5.2.1/com.ibm.p8.ce.dev.ce.doc/sec_procedures.htm
If your web application is deployed on the same WebSphere Cell, you don't need to use Kerberos. Kerberos need to support SSO between WAS and client only, not between application and client.
You don't need to use createSubject(), just get it from security context and provide it to CPE.

worklight 6.0.0 facebook app fails to call a worklight adapter

we are doing worklight app on a android and a desktopenvironment(for facebook) that works fine on the liberty profile server (developer worklight environment).
Know we need to post this app on Facebook but to do this we need to use the https protocol on our WAS server, to do this we set the ip, port, protocol: to our external server, and deploy our app with build for remote server, but when the app tried to call an adapter on the server, the Firefox console returns us this:
[09:58:50.675] "response [https://[publicIP]:[port]/WorklightPocProj/apps/services/../../invoke] success: /*-secure-
{"challenges":{"wl_antiXSRFRealm":{"WL-Instance-Id":"ih80d8pjg6la8ubccb7503b936"}}}*/"
and
[09:58:50.675] "defaultOptions:onFailure Procedure invocation error."
The application security on our WAS server is disabled and the ip/port are reachable too.
if i add to the XML adapter on the procedures securityTest="wl_unprotected" the app runs correctly, but i don't to do this workaround
Is there any configuration that we are missing on the app or in our WAS server?
A lot of time since this question but just for trying to help people that hit this question because of the search "defaultOptions:onFailure Procedure invocation error".
Also facing this issue in Worklight 6.1
In my case I faced this issue because I had the following configuration in the adapter .xml:
<procedure name="anyMethod"></procedure>
This works in the development server, but in a stand alone server (at least in WAS) you have to change it for:
<procedure name="submitAuthentication" securityTest="wl_unprotected"></procedure>
In both cases it is unprotected.

Spring OAuth2 Provider Client Authentication 401 not authorized error using CloudFoundry as client

This question is primarily for the CloudFoundry developers. Has something changed that would make a client application using spring social unable to use basic client authentication to communicate with my core application hosting an oauth2 provider? When I run the client application on a tomcat server everything works. It also worked on a cloudfoundry microinstance about 2 weeks ago. Now I get a 401 unauthorized error making a call to the service at "../oath/token" on my core application. To see what I am referring to, my application is http://www.metroseattlegamers.com If you click the "Games" link at the top it brings you to a separate application. If you sign in using the application at http://gamerepository.metroseattlegamers.com, the "sign in with metroseattlegamers account" button uses custom spring social code to communicate to my spring oauth2 provider code at http://www.metroseattlegamers.com. That all works fine because it is running on two separate tomcat servers on different machines. However, I tested and wrote everything using cloudfoundry micro instances to run client apps. As I said, it was working about a week or two weeks ago. Now I get a 401 error when I run the client on a cloudfoundry instance. Everything still works great when I run two separate tomcat servers on separate machines. Rather than include a bunch of code, I am just curious if anything has changed with how cloudfoundry microinstances work in the last week or two that may have caused this problem.
No as far as I know. Would it be possible for you to file a ticket at the official support page: http://support.cloudfoundry.com. There you can get a private agent to assist and maybe share the implementation of your app to further debug. You will need to sign in by the account you registered on www.cloudfoundry.com.

Resources