public static String [ ] getOAuthKeysForApp ( App app , String prefix ) { prefix = StringUtils . removeEnd ( prefix + "" , Config . SEPARATOR ) ; String appIdKey = prefix + "_app_id" ; String secretKey = prefix + "_secret" ; String [ ] keys = new String [ ] { "" , "" } ; if ( app != null ) { Map < String , Object > settings = app . getSettings ( ) ; if ( settings . containsKey ( appIdKey ) && settings . containsKey ( secretKey ) ) { keys [ 0 ] = settings . get ( appIdKey ) + "" ; keys [ 1 ] = settings . get ( secretKey ) + "" ; } else if ( app . isRootApp ( ) ) { keys [ 0 ] = Config . getConfigParam ( appIdKey , "" ) ; keys [ 1 ] = Config . getConfigParam ( secretKey , "" ) ; } } return keys ; }
Return the OAuth app ID and secret key for a given app by reading the app settings or the config file .