dinasaif / socialauth-android

Automatically exported from code.google.com/p/socialauth-android
0 stars 0 forks source link

Manual addConfig() does not work #110

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Delete oauth_consumer.properties from assets, clear app data from OS 
settings.

2. Initialize as usual, add config manually

socialAuthAdapter = new SocialAuthAdapter(new LinkedInSocialListener());
socialAuthAdapter.addConfig(SocialAuthAdapter.Provider.LINKEDIN, key, secret, 
permissions);
socialAuthAdapter.addProvider(SocialAuthAdapter.Provider.LINKEDIN, 
R.drawable.linkedin);

3. Authorize 

socialAuthAdapter.authorize(this, SocialAuthAdapter.Provider.LINKEDIN);

What is the expected output? What do you see instead?

I expected LinkedIn authorization via WebView. This is what happens:

07-15 12:47:54.861  7647    7647    D   SocialAuthAdapter   Selected provider is linkedin
07-15 12:47:54.861  7647    7647    D   SocialAuthAdapter   Loading keys and secrets from 
configuration
07-15 12:47:54.877  7647    7647    D   SocialAuthAdapter   Could not load configuration
07-15 12:47:54.877  7647    7647    D   SocialAuthAdapter   Starting webview for 
authentication
07-15 
12:47:54.881    7647    7679    D   SocialAuthError org.brickred.socialauth.exception.Socia
lAuthConfigurationException: SocialAuth configuration is null.
07-15 
12:47:54.881    7647    7679    W   System.err  org.brickred.socialauth.exception.SocialAuth
ConfigurationException: SocialAuth configuration is null.
07-15 12:47:54.881  7647    7679    W   System.err      at 
org.brickred.socialauth.SocialAuthManager.getAuthURL(SocialAuthManager.java:148)
07-15 12:47:54.881  7647    7679    W   System.err      at 
org.brickred.socialauth.SocialAuthManager.getAuthenticationUrl(SocialAuthManager
.java:116)
07-15 12:47:54.881  7647    7679    W   System.err      at 
org.brickred.socialauth.android.SocialAuthAdapter$3.run(SocialAuthAdapter.java:5
15)
07-15 12:47:54.881  7647    7679    W   System.err      at 
java.lang.Thread.run(Thread.java:856)

What version of the product are you using? On what operating system?

socialauth-android-2.6.jar
socialauth-4.2.jar
Android 4.1

Please provide any additional information below.

"Could not load configuration" displayed after loadConfig() throws exception in 
the line marked !!!
This means that code marked with ### is unreachable, and user keys added via 
addconfig() are ignored.

SocialAuthAdapter.loadConfig:

        boolean fileExist = false;
        try {
            inputStream = assetManager.open("oauth_consumer.properties");
            fileExist = true;
        } catch (Exception e) {
            fileExist = false;
!!!         throw new SocialAuthException("oauth_consumer.properties not found");
        }

        if (fileExist) {
            // Add keys from oauth_consumers file. loadConfig() method
            // is removed
            config.load(inputStream);
            socialAuthManager.setSocialAuthConfig(config);
        } else {
###         // Add user keys if outh_consumers file not exists
###         for (String key : authMap.keySet()) {
###             config.addProviderConfig(key, authMap.get(key));
###         }
###         socialAuthManager.setSocialAuthConfig(config);
        }
    }

Original issue reported on code.google.com by srd...@atendra.com on 15 Jul 2013 at 10:52

GoogleCodeExporter commented 8 years ago
Thanks , I will check and let you know soon

Original comment by vineet.a...@3pillarglobal.com on 17 Jul 2013 at 11:45

GoogleCodeExporter commented 8 years ago

Original comment by vineet.a...@3pillarglobal.com on 19 Jul 2013 at 8:32

GoogleCodeExporter commented 8 years ago
Hi , we have checked addConfig is working fine. We are updating share-bar 
example with addConfig functionality. Releasing new SDK on 7th october,

Regards
Vineet

Original comment by vineet.a...@3pillarglobal.com on 4 Oct 2013 at 12:07

GoogleCodeExporter commented 8 years ago

Original comment by vineet.a...@3pillarglobal.com on 4 Oct 2013 at 12:08