Open saqueib opened 8 years ago
I also wanted to know is it possible to change OAuth2 configuration value from controller like.
Not possible. In Angular, you must configure a provider before application starts, e.g. in app.config()
block.
I need to send userId to server so I can link the account with user. I have many providers to add.
Double check your code. It works here.
@sahat Thanks for quick reply, I have tested and its strange that its working with Facebook, but on Fitbit
I am not getting the userId
only code
was returned.
Could you open local satellizer.js
file and add console.log(data)
over here: https://github.com/sahat/satellizer/blob/master/satellizer.js#L545 and here, right before sending it to the server: https://github.com/sahat/satellizer/blob/master/satellizer.js#L567
Are you seeing your custom userId value there?
here is what I have tried, I have added console.log(data)
on line 545 & 567. now I have changed the configuration and callback url on Fitbit api panel to http://localhost:3999
to see the response.
http://localhost:3999
and I see
"code" => "9f6acd791c1d062fa4adbaf24a27dc886aa303c0"
undefined
I have had to dynamically change the clientId on my providers, as it is loaded from our web api. I have managed to do this using the following
Configure the $authProvider as normal:
home = angular.module('home', [ 'satellizer' ]).config ($authProvider) ->
$authProvider.github
clientId: '[redacted]'
scope: [ 'user:email' ]
return
Inject the SatellizerConfig object:
home.controller("HomeController", [ '$scope', 'SatellizerConfig'
($scope, SatellizerConfig) ->
And then modify it wherever you need to:
SatellizerConfig.providers['github'].scope = [ 'repo', 'user:email', 'write:repo_hook', 'read:org' ]
This code was taken from this issue https://github.com/sahat/satellizer/issues/658
Hi! I'm very new to satellizer so I might be doing something wrong but I'm trying to set up a login with Patreon button (OAuth2) and the only thing I'm able to get is the response code.
I'm running a simple Angularfire stack hosted on a Apache server.
@saqueib Are we both talking about the same console? You should be seeing that code
output on your server, but I meant the JS console in your browser. It should print out those data values after you modified satellizer.js file.
@sahat yes in chrome dev console I not getting anything, on server which is just below code for testing is giving me code
only
http://localhost:3999 server code
// Get the request
$data = json_encode($_REQUEST);
file_put_contents ( 'data.txt' , $data);
print_r($_REQUEST);
@saqueib Any luck with tracking down the problem?
@sahat thanks for great library, I have used it in many apps.
I am facing a problem where
FitBit OAuth2
is not giving back myuserData
object value, here is the configuration object.and in my controller I am doing
I need to send
userId
to server so I can link the account with user. I have many providers to add.I also wanted to know is it possible to change
OAuth2
configuration value from controller like