Hi,
I am using a library keycloak.js to connect to my keycloak server.
Keycloak.js is plain javascript library. So keycloak manages the
connection to a my server and when it receives the token it deletes the
parameters it receives from the Url.
My problem is that the I am calling some of the keycloaks methods on my
.run(), and aparently AngularjJS is re-adding them to the url. So I get to
funny things happening, if I refresh the page I get the same params added
to end of the url.
Example:
1st time
http://localhost/?code=xxxxxx&state=adfasdf
2nd time
http://localhost/?prompt=noneasdfa&code=xxxxx&state=asfasdf&code=yyyyy&stateasfasdfasdf
So state, code, and prompt keep repeating all ver the url everytime I
refresh.
And the second thing that happens is that I cannot read any of those var, I
cannot read code or state.
If try something like $location.search("code", null), nothing happens, so
then I tried to print $location.search("code"), and there is nothing, , and
code gets added at the end of the url
Like this
http://localhost/?code=xxxxxx&state=adfasdf#/code
If I try to print $location.path() of $location.url() I get and empty
string unless I have a route, but none of the code or the state vars show
up.
I talked to the developers of keycloak.js and they told me that keycloak
cleans the uri and probably because angular is loading all the keycloak
stuff, keycloak.js cleans the uri but then angular adds again the
parameters.
So I have two options:
1) To remove ng-app, run keycloak by itself, and then manually bootstrap
the app when keycloak finishes.
2) Manually fixing the url with pure javascript
Is there a better angular solution for this, thanks
Juan Diego
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.