Quantcast
Channel: DreamFactory Forum - Latest topics
Viewing all 1524 articles
Browse latest View live

Curl. Bad request. No token or api key provided. On login

$
0
0

@adrianblakey wrote:

Any ideas why this does not work?

DreamFactory 2.4.2 RHEL 6.8

curl -i -k -X POST https://host/api/v2/mongodb/user/session -d '{ "email" : "me@some.org", "password" : "password" }' -H 'Content-Type: application/json'
HTTP/1.1 400 Bad Request
Date: Fri, 03 Feb 2017 23:38:02 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
Vary: Cookie
X-Powered-By: PHP/7.0.15
Cache-Control: no-cache
Content-Length: 92
Connection: close
Content-Type: application/json

{"error":{"context":null,"message":"Bad request. No token or api key provided.","code":400}}+ exit

For refn - this does.

curl -s -k https://me%40some.org:password@host/api/v2/mongodb
++ local 'RESULT={"resource":[{"name":"schema"},{"name":"table"}]}'

Posts: 1

Participants: 1

Read full topic


Event script when user register via OAuth

$
0
0

@adib wrote:

Hi,
I need to duplicate user information to another database when user register via OAuth. Is there a way we can do this with server-side scripting?

Thanks

Posts: 1

Participants: 1

Read full topic

Multiple DF instances on same server

$
0
0

@Hussain_Fakhruddin wrote:

Hi, I got a powerful server and now I wish to install multiple DF instance on same server.

I want to use the same mysql as it will be an overkill to use multiple mySQLs

However, if its not possible, I could have multiple mysqls and apache/nginx on different ports. Please let me know how I can do that.

I would like to use the defult installer and change ports, not the source code or manual install because I'm not very technical in compiling from sources etc.

Posts: 1

Participants: 1

Read full topic

How to query the DB with the ILIKE filter

$
0
0

@Sumanth_Neppalli wrote:

When I am querying my table with the Like function, the result doesn't display different case results.

For example, if I am specify a filter "column like %washington" it doesn't display the result which has "Washington". How can I build my query in such a fashion that the results are displayed. I am connecting to a Postgres DB but I don't think dreamfactory supports the ILIKE function

Posts: 1

Participants: 1

Read full topic

Moving everything using Packages messes up my Data

$
0
0

@Julian_Kallidat wrote:

Hi there,

Since I am live with my app, I try to implement a Dev environment. I set up another instance and wanted to copy the whole app+user+roles+scripts+etc. via Package from PROD to DEV. But that what User and Roles and APPs do not have the same IDs anymore. I have some Tables which have the ID of the creator an Information, and also some foreign-key-relations. They are all messed up now.

Is there a way to transport everything in a consistent way?

Thank You very much in advance.

Admin Application Version: 2.2.3
DreamFactory Version: 2.2.1

Greetings
Julian

Posts: 1

Participants: 1

Read full topic

Identify Source of API Call (Script or Other)

$
0
0

@soleson wrote:

Is there any way to identify an API call from a script vs other?

I'd like to build a logging interface upon GET/POST/UPDATE/DELETE and if I need the script to do any form of lookup for the logging action, it'll create an indefinite loop. I've considered placing a custom attribute into the payload for those requests, but from a security standpoint, I'd need a way for users to not be able to spoof that to prevent logging.

A couple Ideas to start:

  1. Add a custom value to the payload array.
  2. Find a value that is only known internally and changes upon each request so that I can validate it.
  3. Some referrer or other identifiable variable in the platform or event objects that would indicate the source.

Thank you in advance for your help.

Posts: 1

Participants: 1

Read full topic

Unicode results in custom scripts

$
0
0

@ehausig wrote:

I can't seem to get unicode characters to return in custom scripts. For example, a simple Python script like the following has a response body of "San Francisco":

cityName = "San Francisco"
return cityName

However if the string contains a special character, the response body is completely empty. For example:

cityName = "Québec"
return cityName

Is this a bug, or is there some special encoding I need to use?

(Note: The "real" service I wrote returns fairly large JSON-formatted results. I noticed some of my result sets were coming up empty when I knew there should be something. The common thread between each result set was that they contained unicode characters.)

Thanks

Posts: 1

Participants: 1

Read full topic

"POST requests without a resource are not currently supported by the 'password' service

$
0
0

@jdubansky wrote:

Hello!!

i am trying to create a page in angularJS that will accept the confirmation code and confirm a user. I have been at this for hours, finished lots of wine trying to wrap my head around this and getting this error among others. I am trying a POST against '/api/v2/user/password' with a data val of '{email: "deprecated", old_password: "deprecated", new_password: "deprecated", code: "deprecated"}' and trust me i have tried almost every other variation of this. it works PERFECT in the API docs and if i use CURL but not from the code below. I checked CORS and the sevices, all have correct permissions. I even upgraded to 2.3 in hopes i was reading the wrong docs. ppppppppppppplease help!!!!

           this.confirm = function (options) {
            var deferred = $q.defer();
            console.log(options);
            var options2 = {resource:[options]};
            console.log(options2);
            $http.post('/api/v2/user/password', options).then(function (result) {
                console.log(result);
                deferred.resolve();
            }, deferred.reject);

            return deferred.promise;
        };
    }

Posts: 1

Participants: 1

Read full topic


For security reasons, this URL is only accessible using localhost (127.0.0.1) as the hostname

$
0
0

@Nishant_Soni wrote:

Hi,

I have installed DreamFactory on the server.

When i am opening following URL : http://server_ip/phpmyadmin

here i am not able to see phpmyadmin, it is showing "For security reasons, this URL is only accessible using localhost (127.0.0.1) as the hostname."

Please suggest me to solve this problem.

Posts: 1

Participants: 1

Read full topic

DF 2.4.1 Add extra information upon open registration

$
0
0

@gnl wrote:

Hi,

I have written a little server side script for user.register.post.post_process event that supposedly has to add some extra information that exists in the payload for this particular user in user_custom.

When I execute the /user/register through the API Docs (while logged in as admin) it works without problems. When this gets executed through my mobile application I get the following error in DF's log:

local.ERROR: Exception: GET access to component 'user' of service 'system' is not allowed by this user's role. {"response":"[object] (DreamFactory\Core\Utility\ServiceResponse: {})"}

What I also have done is that I have created a role called openRegistration and I have given access to

Service: System
Component: user/
Access: GET, PATCH
Requester: SCRIPT

and I have assigned this role to User Service to be given to as Default Open Reg Role and it is actually assigned to self registered user but the script is not able to complete.

Any idea why is this happening or in any case how can I store this extra information upon registration?

Thanks,
George

Posts: 1

Participants: 1

Read full topic

Best practice to consume REST API from multi-Dreamfactory

$
0
0

@glompos21 wrote:

I am designing a system that will have several (30) dreamfactory instances on different computers to server data from a mix of SQL databases (mySQL and Postgress) .

What would be my best option to consume all that data to a central server? Is there a similar option like dreamfactory for consume REST data?

Posts: 1

Participants: 1

Read full topic

Creating a schema with tables within tables?

$
0
0

@Joshua_Vannatter wrote:

Our group is attempting to create a schema that would result in something similar to the the table the image shows, but we're not sure if this is possible without creating multiple tables and just relating them. We would like to just manage one table where one field's data is an array, or json data. Specifically, we want to query into our custom user field and just get back the books for one person, or whatever else we need. Is creating multiple tables and relating them the only way?

Posts: 1

Participants: 1

Read full topic

Access Control Lists for File Storage?

Queued NodeJS Server-Side Script not working

$
0
0

@tizzyapunkt wrote:

Hi guys,

I created a NodeJS Server-Side Script which get's queued on POSTing to an API endpoint.
If I run through the queue with php artisan queue:work --queue=NAMEOFTHEQUEUE, the job doesn't get executed.
The following error appears in the log after starting the worker:

[2017-02-16 19:37:09] local.ERROR: ErrorException: Undefined index: SERVER_PORT in /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/vendor/dreamfactory/df-script/src/Engines/NodeJs.php:56
Stack trace:
#0 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/vendor/dreamfactory/df-script/src/Engines/NodeJs.php(56): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Undefined index...', '/opt/dreamfacto...', 56, Array)
#1 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/vendor/dreamfactory/df-script/src/Engines/ExecutedEngine.php(45): DreamFactory\Core\Script\Engines\NodeJs->enrobeScript('\n//For logging\n...', Array, Array)
#2 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/vendor/dreamfactory/df-script/src/Components/BaseEngineAdapter.php(133): DreamFactory\Core\Script\Engines\ExecutedEngine->executeString('\n//For logging\n...', 'service.fitbita...', Array, Array)
#3 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/vendor/dreamfactory/df-script/src/Components/ScriptHandler.php(32): DreamFactory\Core\Script\Components\BaseEngineAdapter->runScript('\n//For logging\n...', 'service.fitbita...', Array, Array, NULL)
#4 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/vendor/dreamfactory/df-script/src/Jobs/ScriptServiceJob.php(65): DreamFactory\Core\Script\Jobs\ScriptJob->handleScript('service.fitbita...', '\n//For logging\n...', 'nodejs', Array, Array, true)
#5 [internal function]: DreamFactory\Core\Script\Jobs\ScriptServiceJob->handle()
#6 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(1257): call_user_func_array(Array, Array)
#7 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9874): Illuminate\Container\Container->call(Array)
#8 [internal function]: Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}(Object(DreamFactory\Core\Script\Jobs\ScriptServiceJob))
#9 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9970): call_user_func(Object(Closure), Object(DreamFactory\Core\Script\Jobs\ScriptServiceJob))
#10 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(DreamFactory\Core\Script\Jobs\ScriptServiceJob))
#11 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9948): call_user_func(Object(Closure), Object(DreamFactory\Core\Script\Jobs\ScriptServiceJob))
#12 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9875): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#13 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(41): Illuminate\Bus\Dispatcher->dispatchNow(Object(DreamFactory\Core\Script\Jobs\ScriptServiceJob))
#14 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(130): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\DatabaseJob), Array)
#15 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Queue/Jobs/DatabaseJob.php(49): Illuminate\Queue\Jobs\Job->resolveAndFire(Array)
#16 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(213): Illuminate\Queue\Jobs\DatabaseJob->fire()
#17 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(156): Illuminate\Queue\Worker->process('database', Object(Illuminate\Queue\Jobs\DatabaseJob), 0, 0)
#18 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(125): Illuminate\Queue\Worker->pop(NULL, 'fitbitactivityh...', 0, 3, 0)
#19 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(78): Illuminate\Queue\Console\WorkCommand->runWorker(NULL, 'fitbitactivityh...', 0, 128, false)
#20 [internal function]: Illuminate\Queue\Console\WorkCommand->fire()
#21 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(1257): call_user_func_array(Array, Array)
#22 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Console/Command.php(169): Illuminate\Container\Container->call(Array)
#23 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/vendor/symfony/console/Command/Command.php(256): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#24 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Console/Command.php(155): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#25 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/vendor/symfony/console/Application.php(794): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/vendor/symfony/console/Application.php(186): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/vendor/symfony/console/Application.php(117): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#29 /opt/dreamfactory-2.4.2-0/apps/dreamfactory/htdocs/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#30 {main}

If I fire the script directly uppon API call without queu'ing it, it works, so it must have something to do with the queue.

Any ideas on this?

Posts: 1

Participants: 1

Read full topic

JWT Payload component and security

$
0
0

@smilesinblues wrote:

Hi,

I am trying to make the app more secure from MTM attacks, What is the best way to construct JWT payload so that it works and also does not reveal the sensitive user info that anyone can decode.

As of now, I have not been able to construct a payload that works on DF. Please suggest.

Thanks,

Posts: 1

Participants: 1

Read full topic


Is it possible to Use APIs to trigger scripts?

$
0
0

@EM_FLK wrote:

Hello, I am a new users of dream-factory and admittedly I am finding it very overwhelming, I was wondering if this would be a viable platform to be able to run script on an API being sent.

For example if I where to send an API out to dreamfactory with a customers details I would then be able to use the submitted details to make calculations or call other APIs.

Thanks, and sorry if this is not clear.

Posts: 1

Participants: 1

Read full topic

How to change application's API key

$
0
0

@gnl wrote:

HI,

It is written in the documentation that :

Application API Key

Applications in a DreamFactory instance can represent actual application code hosted on the instance, code hosted elsewhere on another server, or a designation for a native mobile app. Each application gets an API key generated at creation. The API key must be used for all access to the API. The API key can be regenerated by administrative request, however care must be taken that all uses of the old key are updated (i.e. this is more difficult for a key embedded in a native mobile application).

The question that I have has to do with the sentence The API key can be regenerated by administrative request. Unfortunately I am not able to find anywhere instructions on how to do that! Can somebody help me out with this?

Thanks

Posts: 1

Participants: 1

Read full topic

How to install Dream Factory

$
0
0

@pritam.maiti wrote:

Hello,

I have 32 bit Ubuntu 14.04 LTS os.So i am unable to install 64 bit Dream Factory.32 bit Dream Factory is not available.Then i try the git hub method.It is also not working.I cant change the os right now.So i have only one option to install DM by Git Hub.I download the DM from git hub.But when i am going to run there are many error coming.

When i am trying to run php artisan dreamfactory:setup command the below errors are coming.

Errors are :

PHP Warning: require(/var/www/html/dreamfactory-master/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/dreamfactory-master/bootstrap/autoload.php on line 17
PHP Fatal error: require(): Failed opening required '/var/www/html/dreamfactory-master/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php') in /var/www/html/dreamfactory-master/bootstrap/autoload.php on line 17

Will anyone help me out from that???????

Posts: 1

Participants: 1

Read full topic

Access DSP system/session variables in mysql triggers?

$
0
0

@Codzart wrote:

Looking for solution.

I'm using MySQL triggers to perform after insert/update and before delete logging of changes to a MySQL table.
Not considering server-side scripting at this point.

In the context of the trigger, the MySQL function USER() evaluates to "appuser@localhost" as predicted, since DF is configured to access mysql running on localhost using "appuser" credentials.

What I think I'm looking for is a connection-related or session-related variable that gets SET by DF whenever a REST API call results in a SQL statement.

I'm running on a resent version of MySQL, and so I have the performance_schema database, if that helps.

I've already looked at performance_schema.user_variables_by_thread, but I don't see anything helpful within the context of a trigger instance.

Posts: 1

Participants: 1

Read full topic

Access multipart/form-data information

$
0
0

@gkeith wrote:

I am trying to create a script to upload a file to another service through DreamFactory. I need to send the file to the other service (Python-Eve) using multipart/form-data, but I would like to check parts of the data first. I have created a custom server-side script (PHP), but cannot seem to access any of the data - $event['request']['payload'] is an empty array and $event['request']['content'] is an empty string.

http://community.dreamfactory.com/t/how-to-upload-a-file-using-custom-script/1228 and http://community.dreamfactory.com/t/file-upload-and-custom-script-service/2557 seem to suggest that it isn't possible, is this still the case? It would be really beneficial to be able to upload files to custom scripts

Posts: 1

Participants: 1

Read full topic

Viewing all 1524 articles
Browse latest View live