How authenticate Google wave gadget viewer on Appengine? - java

Imagine I want to create game "Rock-paper-scissors" for Google Waves.
I am thinking to implement it as a Wave Gadget.
The idea is simple: all participants send their decisions to my cloud
app (it is an Appengine Java Application), my server part collects
this data and does not share to anybody until all participants
complete their selection. After this the selection is shared to all
participants and the winner is determined.
I can use wave.getViewer().getId() to identify user on the server
during gadgets.io.makeRequest. I works perfectly.
But how can I, on the server side, make sure that the incoming request is
really from this specific wave user? (How can I approve that wave's
participant id is not hacked on the client side? Any wave container
signature allowing determine wave participant id is available?)
What are the best practices for google wave participant authentication
on my appengine side? Please provide examples if possible.
My actual gadget is more complicated but the problem is as described
above.

I would code against an imagined future solution that is baked directly into the Wave protocol or API and hope that nobody spoofs participant IDs. You could also contact the Wave team to make your need for the feature known and see if anyone else is looking for the same.
It looks like there is some OpenAuth integration already built-in for robots:
http://wave-robot-java-client.googlecode.com/svn/trunk/doc/index.html
Would you be able to implement a robot instead of a gadget? Or maybe use a robot for auth and have the gadget interface with your own auth tokens server-side?

As far as I can tell there is no "easy" way of doing this because all the communication with gadgets is directly between the client and the gadget, without Google interference for anything but the gadget's XML description.
The only way I can think off the top of my head is to have your users "log in" to the gadget's iframe with the accounts feature of Google App Engine. This would ensure they are indeed whoever they log in as.

How can I approve that wave's participant id is not hacked on the client side?
How can a user hack his wave patricipant id?
I think there's no problem, wave.getViewer().getId() should be right.

I think you'd want to look into making a wave ROBOT instead of a GADGET. There is a difference.
Robots are wave-aware, gadgets are not.
Wave Robot API: http://code.google.com/apis/wave/extensions/robots/

Related

Android Java listener for variable on Spring Boot server change

Hello I am wondering if this is possible to notify Android with some kind of listener the best via Retrofit when variable on server side change (to be specific concrete record on database shows up)?
Or you have any other ideas how can I achieve that with the simplest way.
The use case is that: I am developing Android RPG game. There are players that can fight with each other. They are all located on world map and you can choose the player you want to fight with. And now I want to get information in code once I am attacked or inform another player that he is attacked and open a new arena map dedicated for PvP fighting.
Currently I do it by retrofit call to server that checks if that record in database exists every few seconds but I guess it is not the best solution, as some people can have various internet limitations.
Kind regards.
Check out web sockets. They behave as you need.

Desktop Application Video Encryption

I have few questions regarding development of desktop application and I can only access internet for first login where user will authenticate himself. I have an idea that I'll bring in the key used to encrypt videos from online server and save it to local db so key isn't in the code for anyone to inspect.
Is it a good method? As app will be running offline and I don't want anyone to access my videos.
I will have to decrypt one video and play it unless there is some method that decrypt and play on the fly like libmedia does it in android. I have no preference whether I have to develop it in Java or C#. Which language provides better obfuscation keeping in mind that I only need it for windows OS.
Thank you
It sounds like your are trying to develop a sort of light weight DRM solution - unfortunately, this is going to probably be lightweight in the protection it offers also.
For example, if you store the key in the DB it will still be relatively easy for someone to get to it using a regular DB viewing tool.
DRM is not really about making it impossible to copy content - more about making it hard enough to do that it is 'not worth it'.
Depending on how 'secret' or valuable your videos are your approach may be fine - i.e. you may make it enough work to find the key etc that uses won't bother. If your videos were regular studio produced content then they would probably not be happy with this level of protection.
If you do need stronger protection then regular DRM from MS, Adobe and Google etc is available through many of the standard video hosting providers (Brightcove, Ooyla, Kaltura etc) and the DRM they use will support offline playback, which I think is the requirement you have.
They will also all allow decryption and playback 'on the fly' - i.e. you don't have to decrypt the whole video before you play it back (in fact they would typically not do the whole video decryption first anyway as you would then have the whole content in clear stream making it easier to copy).

Java Eclipse Google App Engine Tutorial for Google Wallet

I preface this with the fact I am a Java newbie. If one has a working web app in Java using Google App Engine, and one is looking for a simple tutorial for how to add Google Wallet to accomplish a pay-per-use requirement of that web site, does anyone have a reference for a very easy to understand tutorial, book, sample, etc.? What Google provides seems to be a jumble.
If it matters, here is a basic outline of what my web app currently does: User enters a little bit of basic data, chooses from some options, hits "submit", and a whole bunch of calculations happen, with a printout of the result. I would like a tutorial or any direction on how to have Google Wallet popup at the point of "submit" and the calculations happen when that process is complete. Nothing fancy.
Thank you in advance. ANY direction is appreciated. I do not need my hand held (although I won't refuse that), just need a good place to visit to get those hands dirty without slamming my head on the desk in utter confusion.
You probably want the Google Wallet for digital goods API.
https://developers.google.com/commerce/wallet/digital/docs/tutorial
On submit you initiate the purchase flow. Then on the success callback you do whatever calculations you need.

Realizing real time Collaborative GUI with Java?

I wanted to create a real time collaborative GUI , as far as my knowledge is concern, i thought java swing MVC roots can play some role in that and can provide the basis. Am i right? i wanted to have experts reviews.
Which network technology/library will be suitable for this purpose and could give the high level support?
example usecase: If one client press the button or move the slider every client's button or slider move etc same for other swing elements?
Please share your ideas if you think something is achievable and can work as an small example or proof-of-concept.
Jibbylala
You likely won't find any out of the box solution to do exactly what you want, but you should be able to leverage existing technologies to do this. If you have a central server, you could use that to coordinate the clients. When one client does something, it could send a message to the server, which would then broadcast out to the other clients (the client could register with the server receive these notifications). If you don't have/want a central server, you could use UDP broadcasting, and clients could broadcast out their activities, and the other clients could listen and synchronize themselves.
Another challenge will be coming up with a messaging protocol to indicate what has changed. Do you envision needing every UI action to be broadcast (i.e. every button press, every component movement, etc), or will it just be a subset of them. If it is all of them, you might want to come up with a generic solution, like set property X on component Y, etc.
Hope this helps.

Video training program

I am looking to create a video training program which records videos - via webcam, user screen capture and captures sound. Now the main problem is that I need a cross-platform (mac and windows) solutions.
I know its possible to use flash to record webcam + audio. But its not possible to record the user's screen via flash.
So am wonder if I should use Java (which i believe will work on mac & windows). I do not want to develop to separate versions because of the cost involved in developing two versions.
Please guide me as I am new to this.
Thank you.
UPDATE
Hello again,
I had a look at the following site: www.screencast-o-matic.com or www.screentoaster.com. I see that they have developed a java applet which helps interact with Windows/Mac to record the screen.
I am wondering how to go about developing something like that and integrating it with Flash (for webcam and audio recording).
Is this a better idea?
This is not an answer to your question, but I strongly recommend against using video for educational programmes. Our company delivers university courses on-line, and we long ago learned that video feeds are only effective under particular scenarios. In general, a talking head is a waste of bandwidth. You're much better off to put together a well designed powerpoint presentation, record a voice-over (and edit it!) and then assemble the whole thing as a flash presentation. This is a non-trivial amount of work, but it provides a much more interesting product for the student.
When to use video:
1) When you are demonstrating something dynamic - Mechanics or Chemistry for example.
2) When you are acting out a scenario or case as an illustration -- For example, threat de-escalation techniques for high school teachers.
When you solve the screen recording problem, seriously consider whether you need full motion or if you can get away with stills. Often the motion is distracting, and a still with good voice over can be more effective. (Hint: Replace mouse pointers with something HUGE before recording -- Like Fox did with hockey pucks)
Try CamStudio. I don't know, if it works on Mac, but on windows, it's the best solution I know. It's open source, so you can use it's source code, if you want to :)
If you're looking to build an application that does all of the recording and screen capture itself, then you might consider using Adobe AIR (essentially, Flash running on the desktop) in combination with Merapi. Merapi is essentially a bridge between Adobe AIR and Java. So for example, for your project, you might use Java to handle the lower-level (but still cross-platform) stuff you can't do natively in AIR, and use Merapi to wire the Java application to your AIR UI.
This is by no means a simple project. Lets get that said and out the way. There are open source (and cross-platform) options for each element, but nothing (I know of) that will do everything for you.
I think the "cleanest" option would be to use Flash for webcam and audio, as you said, and run a VNC server to send the screen video... The only closed-platform code will be the VNC launching code. That should be pretty simple to maintain!
That raises a problem because most people are behind NAT firewalls these days. Setting up port forwarding is a pain in the behind. I've used an app called Gitso before which allows people to connect to me and send their desktop to my screen (for tech support). Its VNC-based and all it really does is add another layer on top of the VNC connection so rather than me connecting to them, they connect to me. That makes the whole business of port forwarding a non-issue.
And once you've recorded everything, there's the final issue of syncing it all back together... Might not be so hard.
Well, Camtasia provides the solution to get your problem done. It can record the onscreen activity and also the webcam video and put them in the same player template. Another screen recorder DemoCreator can publish the screen recording as Flash movie, but can not record the webcam.

Categories