Google Play Market Authentication for Symfony 3 app - php

How can I configure authentication and authorisation to my Symfony 3 app by Google Play Market Account? I tried to use FOSOAuthServerBundle for these purposes. The documentation tells to create a client using ClientManager in this way:
$clientManager = $this->getContainer()->get('fos_oauth_server.client_manager.default');
$client = $clientManager->createClient();
$client->setRedirectUris(array('http://www.example.com'));
$client->setAllowedGrantTypes(array('token', 'authorization_code'));
$clientManager->updateClient($client);
But no words, about where to put this code. But I am already have credentials which I got from Google Console. Is it possible to use them in order to login with Google Play Market account? How to bind them with custom authentication proWhere should I use these credintials? Are there any tutorials about this process in scope of Symfony 3?

The FOSOAuthServerBundle is a server. What you need is a client.
You should try to use HWIOAuthBundle instead or thephpleague/oauth2-client. If none of these libraries fit on your needs, you may find other implementations on Packagist.

Related

How to use Firebase Auth Admin SDK via Rest Api?

We have been developing a multi platform project which will eventually have an Android app, an iOS app and a web application. We are impressed with the features offered by Google Firebase therefore trying to leverage the opportunities.
Since our product is a multitenant software-as-a-service application we have custom authentication requirements. Therefore we followed the custom authentication implementation path of Firebase and it is functional now.
Our mobile clients send login requests to our API server,
Our API server issues customTokens and reponds them back to the clients,
Clients call signInWithCustomToken(customToken) method to sign in to Firebase.
So far so good.
What the issue is, our backend is in PHP and Firebase doesn't have an official Admin SDK for PHP. Yes, there is a package called kreait/firebase-php on Composer however it is far away from covering all of the Auth Admin SDK features. For example, there is a documented disable-user feature which is available on Firebase Admin SDK, however that operation is not implemented on the kreait/firebase-php package.
On the other hand Firebase has a Auth Rest API which just works with the API KEY. However, (I suppose ) it is designed to work on the client side therefore it just has operations for the authenticated user.
Our API server is already hosted on Google Compute Cloud and has the maximum set of access permissions on the Google Cloud services.
We have the Firebase service account file to work with the Firebase Auth services.
What we need is to consume all available Firebase Admin SDK features (possibly via Rest). For example, we would like to call revokeRefreshToken(uid) when a user changes his/her password on one of his/her devices.
Since at this specific issue there isn't any documentation, what would you advise us to do?
Update (25 January 2018)
The above mentioned missing endpoints on the Firebase unofficial PHP Admin SDK are now implemented by the maintainer after a productive discussion on a Github issue. However, I would like keep this question open since the nature of the question is asking for ideas for further collaboration and discussion.
Maintainer of said unofficial PHP SDK here :). You already have updated your original post to include that the SDK now supports the features that were missing.
I am posting this as a dedicated answer to be visible to people arriving here and searching for answers as well.
Although the Admin SDK for PHP is still not feature complete, we are getting there. I added feature matrix to the README of the Github project so that you can quickly see what is available and what isn't.
Going forward, I will implement new features by either implementing things similarly to the official Admin SDKs (especially https://github.com/firebase/firebase-admin-node) and by using the existing libraries provided by the Google Cloud Platform Library.
At some point in the future, Google will certainly provide all the necessary building blocks to use Firebase efficiently with PHP, but until then, I am happy about every happy PHP developer using my library :).
FYI: I just released a new version (4.1.0) which includes support for Firebase Cloud Storage and did in fact use the google/cloud-storage for that.
I think you can use the Identity Toolkit libraries provided by Google. Here's the one for PHP: https://github.com/google/identity-toolkit-php-client

Communicate with oAuth enabled API from Laravel 5

I am developing a website in laravel 5.1. I need to write code which will communicate with some other system using API call. Other system is projected by oAuth. So I first need to authenticate my system using oAuth and then i can make the api.
I am not sure how i can achieve this in laravel. Any help on this is highly appreciated.
There are multiple ways you can achieve your goal.
Laravel Specific Method
There are many packages for handling oAuth Authentication.. e.g. OAuth Service Provider for Laravel 5 from github. You can search similar other packages and use them.
Guzzle
As you need to call the api anyway after the authentication, you need CURL or other packages to do the call. Here Guzzle can help you. Also you can use Guzzle to code your full oAuth Authentication.
Plain PHP Method
You can use OAuth class library to code the oAuth Authentication OR use CURL
Personally I've used Guzzle only to get the Code, Access Token, Refresh Token etc. I hope you'll manage to use Guzzle for this purpose.
You should take a look at laravel/socialite and its documentation here.
This library currently supports Facebook, Twitter, LinkedIn, Google, GitHub and Bitbucket, but it will be pretty easy to create your own custom provider. Just take a look at source code on github.
Other than this you could use some standalone OAuth library like league/oauth2-client. There is also library dedicated for first version of OAuth.

Is Google OAuth a viable solution for this project?

At my company we use Google Apps.
I've written a dashboard application (PHP/Laravel) which is used throughout the organization. It has a custom authentication system, but I'd like to integrate it with other services we use.
The basic use case that I'm interested in is something like this: you come in to the office in the morning, sign in to your email, and you're automatically signed in to the dashboard.
I've been looking at OAuth & reading about how to implement it, but it's not clear to me that it will do what I want.
So the basic question is this: what can Google OAuth do for me?
You can use Google+ Signin which is an OpenID Connect compliant SSO mechanism built on top of OAuth. By extending your applications with OpenID Connect Resouce Provider (RP) functionality and pointing them to Google as the Provider (OP) you would achieve SSO across your applications.
For a list of OpenID Connect RP libraries/implementations that you may leverage for your applications, see: http://openid.net/developers/libraries/

Sign in with twitter in zf 2.2

I am struggling to find out the way how to implement the sign in in zf 2.2 using
ZendService\Twitter
The application will be used for all the user to have their sign up process done by the twitter only
Please help me with this
ZendService\Twitter is the Twitter API implementation: it aims to provide a php component to load tweets from a user, etc. What you are looking for is an identity provider for authentication.
The de facto user module is ZfcUser. This module is extended by ScnSocialAuth and provides integration to authenticate a user via Twitter, Facebook, Google etc.
Use those two modules, configure ScnSocialAuth to your needs and you are able to login via Twitter.

How to customize twitter "via" message in PHP?

I can't find any mention on how to do this with twitter api. I'd like to do it without buying this commercial software:
http://www.webdesigndev.com/photoshop/how-to-brand-your-tweets-with-your-url-and-why-you-should
I mean not just having my appname but putting any name I want at any time.
I think it's chosen when you create the application for the twitter API: http://dev.twitter.com/apps/new
Currently this can only be done if your application implements OAuth authentication to Twitter. In the past, non-OAuth apps were able to send a source parameter, but that has been discontinued for any new apps.
From Twitter's API FAQ
If you would like tweets from your
application to receive a source
parameter, please register an
application and implement OAuth
authentication. We will automatically
include your application as the source
for any tweets sent from your
application.
Also, check out this similar SO question.

Categories