anvilresearch / connect-example-angularjs Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I started trying this out on OS X with docker and boot2docker
mac:connect-example-angularjs dev$ docker -v
Docker version 1.6.0, build 4749651
mac:connect-example-angularjs dev$ boot2docker -v
Boot2Docker-cli version: v1.6.0
Git commit: 9894ae9
In my scenario I first setup [Anvil Connect authorization server (https://github.com/anvilresearch/connect/blob/master/README.md). As a result the Anvil Authorization server runs on localhost:3000.
The first stumbling block was that inplace sed editing is not easily portable between linux and OSX versions of sed. After a workaround this worked for me. One thing that was not so good was that the in place changes made it harder to see what other changes were made in the same file.
Then I followed the setup in this readme, but things would not work. After @oren and @christiansmith helped me out on gitter, I was able to get this going remembering that with boot2docker one had to connect to boot2docker ip
. So instead of connecting to localhost:9000
one had to connect to 192.168.59.103:9000
.
However the browser showed an html file which looked bare of style. The problem was that the bower_components were not served, so all scripts were missing.
After correcting this things seemed to work better and if I recollect correctly I fixed a few things regarding mismatches of the anvil connect server client registration with the requests that were made by the app.
It took me a while to notice that how the authentication redirect worked. The key was that the callback redirect actually served angular index.html under the name callback as this was not defined. I am not sure whether I had introduced this with my tweaks or whether this was intentional. As a result angular would reload completely.
This is different when using a display popup request with the proper callback.
I have documented with some screenshot the interaction I am now seeing with the popup callback in my fork (intended to become a PR).
For better debugging I disabled the session stuff in my fork also.
Should the changes I made be incorporated into this repository?
PS I am planning to add a short section in the README.md to clarify usage without docker and grunt serve.
This repository has bloated in scope and since become difficult to get up and running for a healthy number of users, that have, as a result, spent a considerable amount of time with @christiansmith and myself in hangouts trying to get them up and running, not before it started to take so long as I had to provide the users a copy of an express app I keep locally which is configured to work with Anvil Connect.
I propose we identify the exact factors that are making this repo a deployment pain and work out a plan of action. This repository was, and is, meant to be a quick-and-easy demo app that any user, anywhere, can get up and running in a flash.
Running register_with_anvil_connect.sh
in my connect directory gives me this:
Registring nv add client {
"client_name": "Angular example with popup for http://localhost:9000",
"default_max_age": 36000,
"redirect_uris": [
"http://localhost:9000/callback_popup.html",
"http://localhost:9000/rp.html"],
"post_logout_redirect_uris": ["http://localhost:9000"],
"trusted": "true"
}
Succeeded.
Define CLIENT_ID as follows in authconf.json:
{
...
"CLIENT_ID" : "",
...
}
Using the example with popup, clicking signin gives this in the console for callback_popup.html
:
pageUrl=http://localhost:9000/callback_popup.html#error=unsupported_response_type&error_description=Unsupported%20response%20type
The response_type
is not specified in the demo app, the default from anvil-connect
appears to be 'id_token token'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.