Giter VIP home page Giter VIP logo

Comments (13)

andrewscofield avatar andrewscofield commented on August 9, 2024

Kind of... here is the api methods available in php: https://www.parse.com/docs/rest#users

I say kind of, because if you login a user in via the REST api, it will return their 'sessionToken'. 'currentUser' wouldn't really make sense when making calls via rest, its used to identify the person using the mobile device. The REST api is typically used so a server can add/update/delete data on parse for users, so when they do login, latest data is already there.

But another method is if a user opens your mobile app and makes a call to your php server, you could in theory identify them using a token that when checked against your servers database would point to the 'current user'. This article here, sort of touches on this subject and is a good read:

http://www.thebuzzmedia.com/designing-a-secure-rest-api-without-oauth-authentication/

Not sure if this is your particular use case, let me know if you still have questions though.

from parse.com-php-library.

iantearle avatar iantearle commented on August 9, 2024

Thank you, that's great.
However bumped into a query, might be just me being stupid late on a monday afternoon, but can one login using this library? I tried using the GET method but its requiring an objectid?

from parse.com-php-library.

andrewscofield avatar andrewscofield commented on August 9, 2024

I'm working on that, it will be possible soon.

from parse.com-php-library.

iantearle avatar iantearle commented on August 9, 2024

phew. I thought for a minute I was going mad. I'll hang tight. Thanks.

from parse.com-php-library.

 avatar commented on August 9, 2024

Hi, I'm having similar issues, I just want to get the details of one user with this library - I have tried with multiple user objectIds, I get a 404 error even though the id is perfectly valid.

from parse.com-php-library.

andrewscofield avatar andrewscofield commented on August 9, 2024

Can you please show me a small code sample that is not working for you. Also can you tell me if other functions of the library are working?

from parse.com-php-library.

 avatar commented on August 9, 2024

Here's the code:

    $user = array(
        'className' => 'User',
        'objectId' => $userId
    );
    // fetch user info.
    $json = json_decode($parse->get($user), true);
    print_r($json);

Anything other than user objects, the library works fine and returns the correct data.

from parse.com-php-library.

andrewscofield avatar andrewscofield commented on August 9, 2024

A couple things are off there. It looks like you are using the provided parseUser class. Try something like this instead:

//you first have to setup a new parse user instance
//then you can make all the user functions like get and query and signup. 
$user = new parseUser;
$userData = $user->get($userId); 
print_r($userData);

//Also no need to json_decode any of the stuff this library returns. Already done in the library. 

Check out this file here for more examples:
https://github.com/apotropaic/parse.com-php-library/blob/master/tests/parseUserTest.php

from parse.com-php-library.

 avatar commented on August 9, 2024

Ah, I'm still using v1 of the library, is this fix for the new one?

from parse.com-php-library.

andrewscofield avatar andrewscofield commented on August 9, 2024

yea it is.

from parse.com-php-library.

 avatar commented on August 9, 2024

Ok, here's my code for retrieving a user object:

        $parseQuery = new parseQuery('User');
        $parseQuery->where('objectId',$args[1]);
        $result = $parseQuery->find();
        print_r($result);

I still get an empty response though, even though the table is populated:

        stdClass Object ( [results] => Array ( ) ) 

I have constructed queries to other tables and they do work.

from parse.com-php-library.

 avatar commented on August 9, 2024

Ah, problem solved, I forgot to run your first solution as the new query. Works perfectly now, thanks.

from parse.com-php-library.

andrewscofield avatar andrewscofield commented on August 9, 2024

Sweet! Glad to hear man.. just open up a new issue if you have any other
questions or suggestions.

On Tue, Mar 26, 2013 at 5:31 AM, liquidus219 [email protected]:

Ah, problem solved, I forgot to run your first solution as the new query.
Works perfectly now, thanks.


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-15455246
.

from parse.com-php-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.