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

How to get response in POST_PROCESS script

$
0
0

@shaun wrote:

Hi,

I want to create a record, get the ID from that inserted row, and then create another record in a separate table using the id.

To do this I am creating a POST_PROCESS script.

How do I get the ID result from the inserted record?

Posts: 1

Participants: 1

Read full topic


Some feature requests

$
0
0

@Hussain_Fakhruddin wrote:

  • Database based roles should have limit on what “columns” should be returned. This would make life really easy in terms of not having to write post / pre script validations on which roles could access what data.

  • Database roles need to have more conditional script as more advance filters than just column level. Many a times a related filter needs to match. Its very inconvenient to write post scripts for each roles and make more queries. I feel if a validation script could be included as part of role it would be really great. This way, not just DB permission, but a custom access could be given at the ROLE level based on business requirement.

  • A more precise Google / FB auth using Native SDK tokens ( not kind of shadow user ).

  • User management is at single level only. It cannot be matched with Org/Department level or APP level. A lot of code needs to be written if we were to have multiple orgs under same instance. Most large API platforms have this. ( Usergrid, Apigee etc ).

  • HTTPS certificate management via the admin panel itself is very important for out of the box solution.

  • API documentation UI needs a lot of improvement. It just doesn’t fit in most of the laptop screens. Good we have large screens but definitely can be improved.

  • Cache ON/OFF switch on Admin panel.

  • Service Package groups - Would be great to have groups of packages. This way all the services could be grouped together.

  • Advance code editor. Current one is really not helpful if we want to do the changes right there. Although its improved from previous editor, I think there is more room for improvement.

  • Global files like Global lookup keys. Would be nice to have some small static files which could be referred as config files for the business logic.

  • Template Roles. Currently there is no way to restrict who can access which template ID. For example, any user having access to email can use any template to make a call. I might be wrong, but I never found any template based assignment for roles.

Thoughts ?

Posts: 2

Participants: 2

Read full topic

Alternate User Authentication

$
0
0

@cookeal wrote:

Bitnami on AWS 2.11 fresh install:

Was unable to get this to work on an existing instance, so have set up a vanilla instance and despite following the instructions here: http://blog.dreamfactory.com/alternate-user-authentication am still unable to get this working.

DF support have also been unsuccessful in diagnosing this, despite having full admin access to my installation, which leads me to wonder whether anyone has been successful in implementing this feature, and if so would be able to point out any pitfalls I may have fallen into?

Appreciate any thoughts

Posts: 1

Participants: 1

Read full topic

Mysql 5.6 not supported 767 error

$
0
0

@lastlink wrote:

I get this error on user, system_custom, & cors_config tables.

Specified key was too long; max key length is 767 bytes.
Is mysql 5.6 not officially supported anymore?
Ref: https://stackoverflow.com/questions/1814532/1071-specified-key-was-too-long-max-key-length-is-767-bytes

After some experimentation I’ve determined it to be the email length of 255. It seems when using a unique constraint and character set of utf8mb4 which is 4 bytes each that you hit the max of 767. So 767/4=191 which works as length for email.

In the other tables they are name & path which need a length of 191.

Posts: 1

Participants: 1

Read full topic

OAuth using Google

$
0
0

@Kani_Lakshmikanthan wrote:

Hi , been trying to integrate our Nodejs application with Dream Factory. We rely on OAuth for authentication. For this we use Google OAuth. When OAuth is done at Dream Factory side, redirection happens to our application. But I am not able to get session token from Dream Factory. How to get session token from DF, when one uses Google OAuth ?

Posts: 1

Participants: 1

Read full topic

URL for Public Access to Files

$
0
0

@dougster wrote:

Hi
I have DF up and running, and my IOS app posts to a folder.

My files are posted to /opt/bitnami/apps/dreamfactory/htdocs/storage/app/myfolder (which is my subfolder under files).

I would like to be able to access these publicly by URL so i can send as mms using Twilio.

I have set the config in the file services ‘public folder’ setting as app and experimented with various things in the public path but cant get it to work.

Ideally I would like to be able to access the files as say mysitename.com/myfolder/myfilename.jpg

Any clues?

Posts: 1

Participants: 1

Read full topic

How to integrate SCIM server (Basic Auth) with sailpoint IIQ?

Token refresh not working

$
0
0

@qwarl wrote:

Hi there!

I’m having an issue when refreshing the JWT token on my dreamfactory 2.11.1 bitnami installation.

I’ll just get an HTTP 401 “Token has expired: …” when I try to refresh it after the JWT time to live and before the Refresh time to live. Refreshing within the JWT time to live works, but that’s for sure not the right way to go…
Did the tutorial from here: http://wiki.dreamfactory.com/DreamFactory/Tutorials/Refreshing_a_JWT

my config seems to be ok, when I do GET /api/v2/system/environment as admin I see:
“df_jwt_refresh_ttl”: “20160”,
“df_jwt_ttl”: “60”,

My steps to try to refresh the token:

login:
POST ‘/api/v2/user/session’ with payload ‘{“email”:“XXX”,“password”:“XXX”,“remember_me”:true}’

refresh:
PUT ‘/api/v2/user/session’ with empty payload and the headers Content-Type, X-DreamFactory-Api-Key, X-DreamFactory-Session-Token set.
tried PUT ‘/api/v2/user/session?session_token=TOKEN’ too.
but I still get a HTTP 401 error saying “Token has expired: Session expired. Please refresh your token (if still within refresh window) or re-login.”

Thank you in Advance for your suggestions what I could do.

Posts: 1

Participants: 1

Read full topic


Secure Promo-Code Retrieval for Unity-App

$
0
0

@Miriam_Tschanen wrote:

Hi all,

I’m a complete noob when it comes to webservers and REST, so this is causing me a bit of a headache. I’m developing a Unity game that rewards players with a single, once-usable promo code that they can later exchange for certain services at a partner company. We decided to use DreamFactory to store and access the codes, but I really don’t know how to do any of this. Here’s what we need:

  • our app runs natively on an Android or iOS phone, developed in Unity
  • a user should be able to receive a new promo code exactly once
  • to achieve this, the app sens a request with the API Key and the user’s phone number. A serverside script then checks if we’ve generated a code with that phone number before. If not, it returns a new one and remembers the phone number. If we have seen that number before, it returns the code previously associated with that number.

First of all, is this possible, and can someone point me in the right direction for setting all this up? Secondly, is the API key sent with the request in plaintext? Because if a user can get the API key easily by monitoring their web traffic, they could then generate an unlimited number of codes with bogus phone numbers. I read somewhere that I can enable HTTPS when setting up the server, but I don’t know how to do that. Would that even fix the issue?

Posts: 1

Participants: 1

Read full topic

Error 503 in response from HTTP POST

$
0
0

@yennster wrote:

Hi, I am at a loss as to why I am unable to POST successfully to my Dream Factory instance. I am able to send a curl from command-line successfully and receive the correct response, but when I format the data as a regular HTTP POST request and try to POST from my microcontroller C code, I get a 503 error. It looks like the error is from the ClusterService.php file. Any thoughts?

Here’s my successful curl (with authorization information redacted):

curl -X POST "https://<redacted>.dreamfactory.com/api/v2/testdb/_table/Measurements" -H "Content-Type: application/json" -H "accept: application/json"  -H "X-DreamFactory-API-Key: <redacted>" -d "{\"resource\":[{\"userID\":1,\"weight\":1,\"timestamp\":\"2018-02-17 21:05:13.5096722\",\"productID\":2,\"created_date\":\"2018-02-07 21:05:13.5096722\",\"last_updated_date\":\"2018-02-07 21:05:13.5096722\"}]}"

Curl successful response:

{"resource":[{"measurementID":21}]}

And here’s my unsuccessful HTTP POST request as used in my esp32 microcontroller code:

POST https://<redacted>.dreamfactory.com/api/v2/testdb/_table/Measurements HTTP/1.0
Accept: application/json
Connection: keep-alive
Content-Type: application/json
X-DreamFactory-API-Key: <redacted>
{"resource":[{"userID":1,"weight":32,"timestamp":"2018-01-02 00:00:00.00","productID":2,"created_date":"2018-01-01 00:00:00.00","last_updated_date":"2018-01-01 00:00:00.00"}]}

MCU error response:

HTTP/1.1 200 OK
Server: nginx
Content-Type: text/html; charset=UTF-8
Connection: close
Cache-Control: no-cache, private
Date: Wed, 28 Feb 2018 18:28:55 GMT
x-dreamfactory-routed: true

{"error":{"code":503,"message":"Error interrogating console: Corrupt response during status query for \"\"."}}

I did a google search for “Error interrogating console” and I was directed to this GitHub repository. Any guidance would be very much appreciated!

Posts: 1

Participants: 1

Read full topic

Access End Point

PHP get_file_contents POST- no records detected

$
0
0

@Lorderich wrote:

Hello,

i am trying to post data do a defined rest API.

$input = new \stdClass();
lastname = _POST[‘usrlastname’];
$input->familyname = $lastname;
firstname = _POST[‘usrfirstname’];
$input->firstname = $firstname;

$json = json_encode($input);
$data = ‘{“resource”’.’:’. ‘[’.$json.’]}’;

//Set stream options for api-access with post
$posts = array(‘http’ => array(
‘user_agent’ => ‘custom user agent string’,
‘method’ => ‘POST’,
‘ignore_errors’ => true,
‘header’ => “X-DreamFactory-Api-Key: $apikey”,
‘resource’ => $data));

$post = stream_context_create($posts);
$requesturl = $apiurl.’_table/Person?fields=UUID,LoginName’; // path to your JSON file
$request = file_get_contents($requesturl, false, $post); // put the contents of the file into a variable

When i try to post the data, i am getting the message, that:
REST Exception #400 > No record(s) detected in request. Please make sure record(s) are wrapped in a ‘resource’ tag. Example: {“resource”:[{“record”:1},{“record”:2}]}

But the records are included with
’resource’ => $data

and looks like this:
{“resource”:[{“familyname”:“Jacobi”,“firstname”:“Ren\u00e9”}]}

So the full request is formatted in this way:
Array (
[http] =>
Array (
[user_agent] => custom user agent string
[method] => POST
[ignore_errors] => 1
[header] => X-DreamFactory-Api-Key: key
[resource] => {“resource”:[{“familyname”:“test”,“firstname”:“user”}]} ) )

Posts: 2

Participants: 1

Read full topic

Pretty urls for HTTP GET

$
0
0

@opn wrote:

I’m looking to be able to use DreamFactory to create an alternative server to an existing simple javascript client. I need to be able to conform to the clients restful api scheme. As far as i understand there is no way to get rid of the requirement for APIKey entires in the url as this is how DreamFactory identifies an app.

I’m wandering if modifying DreamFactories Nginx config directly would cause problems / seems a good way to go - the issue would be upgrading I guess? Perhaps it would be better to add a second Nginx proxy seem like overkill?

Posts: 1

Participants: 1

Read full topic

Issue updating request data from post.pre_process

$
0
0

@Anil_Thakkar wrote:

Hi There,

I am using windows version of DF.

I am unable to update resource from event. below here is my event and code within event. I can READ and VALIDATE the values but when I try to update the same value during post.pre_process, its not reflecting in db.

Event Name: mysql mysql._table.{table_name} mysql._table.{table_name}.post.pre_process mysql._table.employee.post.pre_process

Code:

event.request.payload.resource[0].salary = 90;

Note:
I have enabled both check boxes “Active” and “Allow script to modify request payload”. I am sure that Event is triggering because I can validate the data and throw errors.

Posts: 1

Participants: 1

Read full topic

Console.log is not writing log

$
0
0

@Anil_Thakkar wrote:

Issue: console.log is not working log. It’s not working in any browser, I have tried chrome and firefox.

Code written using node.js language type in event “mysql._table.employee.post.pre_process”,

Code:
console.log(“Hello world”); // outputs to file in storage/log of dreamfactory install directory.

Notes: other system logs are getting written to the log file under “logs/dreamfactory.log” so, there is no issue of permission I believe.

Posts: 1

Participants: 1

Read full topic


Connect to Firebird Database

$
0
0

@MrSpock wrote:

I installed the bitnami stack of dreamfactory locally on my MacBook. On the services page I added a firebird service and made the following entries in the config form:
Host: 127.0.0.1 (I also tried localhost)
Port: 3050
Database: /Users/myname/DB/VOKABELN.FDB
Username: SYSDBA
Password: masterkey

With these settings I can access the database e.g. with flamerobin
I have installed the 64 bit version of firebird 2.5.8

When I select DATA and there the firebird service, I receive the following message:

SQLSTATE[HY000]: General error: -206 Dynamic SQL Error SQL error code = -206 Column unknown RDB$RELATION_TYPE At line 2, column 59 (SQL: SELECT TRIM(RDB$RELATION_NAME) AS RDB$RELATION_NAME FROM RDB$RELATIONS
WHERE (RDB$SYSTEM_FLAG=0 OR RDB$SYSTEM_FLAG IS NULL) and (RDB$RELATION_TYPE = 1):wink:

I also tried to use the API, but I cannot access any firebird db. How can I manage to access a firebird database?

Posts: 1

Participants: 1

Read full topic

Remote Web Service (RWS) server-side scripts not working

$
0
0

@Nick_Spisak wrote:

Been trying to get server-side scripts to work on my custom remote webservice for a long time now. I’ve tried to even simply just log to the dreamfactory.log file. I can get it to work against out of the box services like /api/v2/db/_table but as soon as I try the same log code against my rws it doesn’t work.

Posts: 1

Participants: 1

Read full topic

Filter expression to check if a string contains the column value

$
0
0

@vijayst wrote:

I am checking if a string contains the column value. For example, let us say, we have an org_id field. And there is a comma separated string of org_ids like: ,123,227,4,89,.

I want to write a filter query which does:
“,123,227,4,89,” contains “, + org_id + ,”

The above is not SQL but just a pseudocode. Hoping if DreamFactory filter has something for this.

Posts: 1

Participants: 1

Read full topic

Decentralised DreamFactory Hackathon

$
0
0

@opn wrote:

I’m organising a microservices hackathon in London and other locations around the world (Brzil, Peru, Paris, Berlin…). Does anyone want to join in? The event is designed to be a regular series of events where we explore the use of microservices between organisations. In the process we all learn a lot more about DreamFactory and grow the community!

The date is not yet completely fixed but we are looking at an early event mid-May 2018, and the event proper towards the end of July 2018. Participation will be possible online or at local venues.

A core unusual aspect of the hack will be the use of Zoom meetings and breakout sessions. We will use these to facilitate developers working together across authenticated microservices hosted on DreamFactory instances around the world.

Any thoughts, comments and suggestions appreciated.

Posts: 1

Participants: 1

Read full topic

NodeJS post_process scripting for user/session example - Error 500

$
0
0

@flpozzato wrote:

Hi everyone,

I’m trying to append some extra data on user session object after user login, but somehow DF keeps returning 500 error after I call the api.
This is simple code, but I don’t know why it’s breaking.

var url = 'mysql/_table/extra_data/';
if(event.response.status_code === 200) {

    if (platform.session.user && platform.session.user.email){
	    var email = platform.session.user.email;

        platform.api.get(url + email, null, function(body, response) {
            event.response.content.extra_data = {
              JSON.parse(body)
            };
        
            event.response.content_changed = true;
        });
    };
}

Any clues?

Thanks!

Posts: 1

Participants: 1

Read full topic

Viewing all 1522 articles
Browse latest View live