custom authentication and authorization on GAE - google-app-engine

im trying to understand how to implement my own authentication and authorization machinery for my GAE app. does anyone already implemented something like that and maybe can give me some advice?
what i need is grant access on certain sections to specific users and restrict the access to others.
i looked at repoze.who and reapoze.what but its not really clear to me how to use them on app engine.
thank you

Maybe taking a look at tipfy.ext.auth (doc, wiki, source code,) and tipfy.ext.acl (doc, wiki, source code) would provide you with a little kickstart. Those are extensions built on top of tipfy, a open source lightweight python-based framework made for GAE.
In order to get a better understanding of their usage and implementation, make sure to peek at the source code of each and the associated testsuites.

From your question it is not clear if you are using java or python. I have done my custom user management with authentication/authorization using spring-security in java GAE. Things work fine.
Here and here are some more info/links from me.

Related

Calling MS Dynamics CRM SOAP Service using Angular JS

I am developing an ionic application which will interact with MS Dynamics CRM. I have looked online for solutions, but all solutions are either RESTful implementations or non MS Dynamics implementations. Has anyone implemented SOAP services of MS Dynamics using Angular JS? If possible please share example.
Several questions that probably will lead you to solution:
Do you have special requirements to use SOAP? Most of CRM functionality successfully exposed via REST / OData endpoints. Only for really none-trivial cases you would need to use SOAP syntax. You can check list of current limitations here. Consider using REST instead.
Another question would be, where your application is deployed? Is it within CRM itself? Or not? If Angular application is started within CRM (as WebResource) this is a lot simpler! Since you are already authorized to the service and you don't need to bother about that. In this case maybe this library could provide you some help... there are several approaches to create great middleware for SOAP requests to CRM, this seems to be most modern one.
But if you're not authorized... This is whole new level of the problem... Which environment you're targeting? OnLine? OnPrem?
In that case, first you need to authorize, then you can proceed with your queries, for example with the help of the library on previous step. There is one JS library that could help. It is abandoned, but you can take a look on the code. I'm talking about dynamicscrm-api. It won't work in browser, but it will give you understanding, how you can move on.

Adding ACL support to parse4cn1

I'm working on an app written in Codename One together with the parse4cn1 library, the combination of which is a real pleasure to use. However, I need support for a few things in parse4cn1 that are not implemented, most importantly ACL and was wondering if Chidiebere has any hints on how to do this (e.g. how did you implement parse4cn1 yourself - from scratch or copying the open source Parse SDK for Android)? If I manage to do something of a decent quality I will try to share back. Thanks in advance
I never got around implementing ACLs (it's still on the TODO list). parse4cn1's interface closes resembles the Parse Android SDK interface and I'll like it to stay that way for convenience. In this case, the interface of interest would be the ParseACL which is documented here.
The actual implementation will need to be done via REST API calls.
Things to bear in mind:
We use the Android SDK API simply for defining methods and signatures for the corresponding class in ParseACL but do not use the SDKs for anything can be be done via REST.
By design, any calls requiring the master key will not be supported in parse4cn1 due to security considerations. If really needed, the functionality should be exposed via server-side cloud code.
Pull requests without unit tests for the added functionality or breaking existing tests will be rejected.
See also the Contributions section of the parse4cn1 github repo.
Good luck with your implementation and I hope to see a PR from you soon ;)
It was implemented from a Java port on top of the REST API's here but was later modified to use the SDK's to allow things like push (which are now no longer relevant).
In the past I just contributed pull a request to the project to get the fixes/features I needed. It was really easy to work with and compile.

How to publish AIML embedded with javascript?

I've written an AIML file for a chat bot and I'd like to build an interactive web application which allows me to chat with the bot in the web browser.
Is it possible to achieve this with HTML & Javascript?
There is no short answer on how to write a web application which allows a user to interact with your AIML. Writing such an application from scratch will be much more work then compiling the AIML was.
The easiest option would be to use a pre-built service like PandoraBots which allows you to upload AIML files and interact with them in the web browser. It's free to use the explorer part of website. They also have paid developer options which generates an API to bridge your AIML script and any applications you might want to build. It can be easily connected to work with common chat apps like Google talk ect.
If you decide to build everything from scratch you might want to check out the AIML Interpreter library for nodejs.
UPDATE: Here is a node.js based interpreter that you might find useful https://github.com/mrchimp/surly2
I was looking at AIML too and had similar questions. I just found RiveScript RiveScript and it looks like it fits your need to run javascript based on a match. It is not AIML, but very close. There is also at least one tool to convert from AIML to RiveScript, so I would say this fits your needs within those constraints.

MEAN stack authentication

I am new to the MEAN stack and am struggling to find any appropriate literature, or helpful tutorials for my problem.
I am developing a blog site, which will also have an admin content management system for adding new blog articles. I want to be able to login to the system and access restricted content. The content on specific URL's can only be viewed if the user is logged in and so on...
I am struggling to find a good authentication tutorial that goes through the process step by step. As I am new too the syntax and semantics of AngularJS and NodeJS, I need something that will break down each process and define the methods.
Would anyone be able to point me in the right direction for my problem?
To be honest I have recently started myself.
Take a look at meanjs.org or even masteringmean.com
Perhaps this video could help you?
https://masteringmean.com/lessons/601-Angular-e2e-Protractor-Testing-Interacting-with-Thirdparty-Sites
I remember having timing issues at one point, which is actually mentioned here.
I do agree as well that perhaps its useful to look at understanding middleware and how to respond to requests with the connect framework.
Here is a simple MEAN stack implementation (but using a DEPLOYD nodejs framework) This you can use for rapid learning of MEAN stack. (Disclosure: I'm a contributor to this MarsCMS)
https://github.com/moorthi07/MarsCMS/
#user37... Checkout satellizer, https://github.com/sahat/satellizer.
It's a complete token based Oauth with a bonus for social logins.
Reply back here if you have any Qs.

How to wrap a C library so that it can be called from a web service

We have a library with very complex logic implemented in C. It has a command line interface with not too complex string-based arguments. In order to access this, we would like to wrap the library so that it can be accessed with simple XML RPC or even straightforward HTTP POST calls.
Having some experience with Java, my first idea would be
Wrap the library in JNI/JNA
Use a thin WS stack and a servlet engine
Proxy requests through Apache to the servlet engine
I believe there should already be something simple that could be used, so I am posting this question here. A solution has the following requirements
It should be deployable to a current linux distribution, preferrably already available via package management
It should integrate with a standard web server (as in my example Apache)
Small changes to the library's interface should be manageable
End-to-end (HTTP-WS-library-WS-HTTP) the solution should not incur too much overhead, but reliability is very important
Alternatively to the JNI/JNA proposal, I think in the C# world it should not be too difficult to write a web service and call this unmanaged code module, but I hope someone can give me some pointers that are feasible in regards to the requirements.
If you're going with web services, perhaps Soaplab would be useful. It's basically a tool to wrap existing command line applications in SOAP web services. The web services it generates look a bit weird but it is quite a popular way to make something like this work.
Creating an apache module is quite easy and since your familiar with xmlrpc you should check out mod-xmlrpc2. You can easily add your C code to this apache module and have a running xmlrpc server in minutes
I think you may also publish it as a SOAP based web service. gSoap can be used to provide the service interface out of the library. Have you explored gSOAP? See http://www.cs.fsu.edu/~engelen/soap.html
Regards,
Kangkan
Depends what technology you're comfortable with, what you already have installed and working on your servers, and what your load requirements are.
How about raw CGI? Assuming the C code is stateless between requests, you can do this without modifying the library at all. Write a simple script which pulls the request parameters out of the CGI environment, perhaps sanitises the input, calls the library via the command-line interface, and packages the result into whatever HTTP response you want. Then configure Apache to dispatch the relevant URL(s) to this script. Python, for example, has library support for XML-RPC, and so does every other scripting language used on the web.
Servlets sound like overkill, but for instance if you want multiple requests per CGI process instantiation, and don't feel like getting involved in Apache configuration, then it might be easiest to stick with what you know.
I'm doing a similar thing with C++ at the moment. In my case, I'm writing a PHP module to allow PHP scripts to access the logic in my C++ library.
I can then use whatever format I want to allow the rest of the world to see it - initially it will just be through a PHP web application but I'll also be developing an XML-RPC interface.
If you're going down the JNI route, check out SWIG.
http://www.swig.org/Doc1.3/Java.html
Assuming you have headers to project bindings with, swig is pretty easy to work with.

Resources