Login / Register API With Laravel 5 [closed] - api

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
How do I can create an API with laravel 5, That will be used for login /register for mobile app? Is there any useful tutorial for this type of API.
Like when someone sends a request from a mobile application, I need to authenticate and then send the proper response against that request.

I've made a very simple version in jQuery format as for example and hosted on GitHub.
Here are all the changes from a fresh Laravel: See all changed files
Feel free to adapt to your code.
You can check the step in each commit.
Create the project (Don't forget to run php artisan make:auth)
Make login support AJAX request (instead of auto redirect) 1a47de4
Login with AJAX (submit login data via AJAX, Please CSRF token header) 80be34d
Make register support AJAX (same as step 2) 89f6dd7
Register via AJAX (Same as step 3) ab8d2d7
Use redirect path from Laravel (Bonus) 27b9a1c4
By the way, for the mobile app, you may need to use access token instead. My example is for web app session. Laravel already have the particular method already just twist a bit.

If you need to create a login register with laravel you can simply use the Heto Multi auth.. All the required details are there..
Heto Multi Auth
Hope This will be helpful

There is a popular tool named - Dingo API which is specially created for Laravel / Lumen Frameworks and is meant to provide you, a set of tools to help you easily and quickly build your own APIs.
The package provide you with these set of features:
Content Negotaition
Authentication
API Versioning
Throttling
Formated / Transformed Responses
API Blueprint Documentation
and much more.
You can find the full documentation of Dingo API here >>

Creating a REST Api on Laravel isn’t very difficult. All we need to keep in mind is that where to start and how to prepare RestFull resources. As usual, you can follow this link: Build Rest Resources With Laravel
And if you want that your API works with Mobile Applications you should use tymon/jwt-auth package.
you can find the tutorial to work with laravel and tymon/jwt-auth in this link: Create an API Server for Mobile Apps using Laravel
The tymon/jwt-auth contains:
Installation of the package.
Configuration
Creating Tokens
Authentication
And the link for tymon/jwt-auth package is:
tymon/jwt-auth package

Here is a solution that shows how to set up register/login/logout endpoints but he changes it slighlty so we don't get the nice effects of too many login attempts etc. https://www.toptal.com/laravel/restful-laravel-api-tutorial
I am still looking for a tutorial on how to do this, will share when I find.

Related

How does Nuxt.js Server Side Rendering Work? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 months ago.
Improve this question
I mostly work with Next.js for web projects. Work demands I work on a project that uses Nuxt.js (v2).
I got up to reading on Nuxt. From pouring over the documentation for the last couple of days, there are a few questions that still linger.
Static-Site Generation: I did dabble in it a few months back, but ended up not using it for anything substantial. It seemed fairly straightforward, not much different from using Next.js for purely static-sites using getStaticProps() exclusively for fetching data at build time. Dynamic data fetching and authentication can happen at the client-side very much like it would happen for an SPA. Static data at build time ensures good SEO.
Server-Side Rendering (on Next): For Next.js this was simple as well, every time a page is requested getStaticProps() will block it from rendering until it can resolve with the props data on the server itself. A completely rendered page is returned to the client, from there on out, the client can still call our api routes for immediate dynamic data using XHR.
Server-Side Rendering (on Nuxt): Reading the documentation on Nuxt.js and working out a small sample project, Nuxt.js it seems works differently in SSR (universal), only the first request produces a server-rendered page, here on out, both data-fetching functions, asyncData() and fetch() run on the client-side (javascript bundles for the pages are preloaded using the Nuxt Router).
My question is, what is the benefit of this approach? This will not help out with SEO, secrets can not be stored on the server because the code can execute on the browser. Is there something I am missing? I searched the docs and could not find anything that makes pages render on the server for every request, as a server-rendered application should.
I'm working with Nuxt 3 and as far as I know you can use useAsyncData() and useFetch() in both client and server. Nuxt 3 SSR universal works fine with SEO because crawlers not cache files so every request is separate, so crawlers get every time SSR HTML file from server. You can use secrets if beside web page you want to create API calls from "server" folder, this is separate functionality to make API calls it not marge with web page. Calling this API will send user only for example JSON file, not whole code from a server/*.js files.

How to display data in Shopify Store from external API using app proxy

My goal is to display data retrieved from a 3rd party (external) API that requires authentication in my Liquid Shopify theme.
I'm looking to access product options data from the Hulk Product Options API, which requires authentication, as documented here: https://productoption.hulkapps.com/api-docs/index.html
My goal would be to send a get request and retrieve data from the Hulk Product Options endpoint.
I've read that an App Proxy is what I need to set up, however I am new to the Shopify app world and am totally lost at how to set this up.
What I've done:
Followed the steps here to create an app and install it on a development store that I created through my partners dashboard.
Went to the partners dashboard, clicked "Apps" and found the app proxy section.
Questions:
What do I put in those fields? I can't find examples for filling out that section with info from an external API.
What code in which file do I need to add to the node app that was generated using shopify node create. Or is this app just necessary to be able to fill out the app proxy info?
What url can I send a GET request to using AJAX / JS in my liquid theme code?
I'm a theme developer new to app development and have never created an app, so if you can provide basic and specific instructions (code would be wonderful!) for someone who knows front-end and is competent but is lost in the app world it's much appreciated. I've asked other theme developers who also have also tried and not been able to figure this out, so there seems to be a gap in the tutorials and resources provided.
Thanks in advance!

REST API for Joomla 3.0 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed last year.
Improve this question
I'm currently using the Joomla 3.3.6 and need to find a REST API to access the content information, user information and etc. I already tried to use the following REST API, which is developed by TechJoomla, but unable to find a proper documentation about the sample requests, authentication process and so on.
https://techjoomla.com/rest-api-for-joomla
And also i considered the jbackend REST API which is developed as an extension for joomla which seems to be a paid extension.
After lot of googling i'm still struggling to find a REST API to access the Joomla content. Please help me with this issue.
Thank you in advance.
I ran into the same issue as well which is why I ended up developing a RESTful API for Joomla 3.4.x, powered by the Slim PHP micro-framework. Please note that this is a commercial Joomla package.
The package includes the following:
Services Control Panel component
Joomla "services" add-on library which includes a version of Slim v2.6.2 (along with several other libraries) obtain via composer and normally found in the vendor folder. More on this later...
Services Joomla Plugin
Services REST Plugin
Services Slim Configuration Plugin
Slim JSON API View plugin
Slim JSON API Middleware plugin
You might ask, "What is the point of all these plugins?"
The answer is that it allows for compartmentalization of functionality of the core components and opens the door for an easily extensible services routes architecture. Note that new plugins could easily be added with Joomla ACL restricting access to those new routes, for example.
The Services Control Panel allows for creation of tokens on a per-user basis (or even multiple tokens per Joomla user). It also allows the end user to configure the Slim micro-framework parameters and even include a threshold for the API rate-limiting functionality (currently based on requests-per-minute). Actually, that part is totally awesome as it provides live feedback on the state of the API rate threshold within the response header.
The cAPI Core package ("cAPI", short for "Constant API" because everything needs a product name...) is just that - a core package. There is a host of add-ons currently in development, the first one being a secure LDAP JSON API (which connects to Microsoft Active Directory), with lots more cool add-ons to come.
The whole point of all this is to say that, basically, your request has been answered and now a commercially supported solution has finally arrived. Plus, instead of reinventing the wheel, I based the extension on a popular, existing micro-framework (Slim), making it easier for developers to work with or develop on the core, pluggable, framework.
So, you get the best of Joomla (robust ACL, advanced plugin architecture, wealth of extensions) and Sim (proven, standards-compliant, mature RESTful PHP micro-framework), all in one easy to install package.
Exposing a website via an easily queryable API should not be taken lightly. I would hope anyone choosing to do this would implement 100% HTTPS access and security-harden their server(s).
You can find more information here: http://getcapi.org
Hope this gets you going in the right direction.
One more thing:
I read over your question again and read that part about your need to access users and content. These were actually the first service endpoints I worked on:
/api/v1/user/
- Can be used to log a user in and out and returns the activated Joomla session in the response
- This also provides for multimodal authentication (both via token in header or username & password in URL string). Basically, it works with your needs.
- You force a user logout like this:
/api/v1/user/logout/username/joomlasessionid
Basically, this is tailor-made for driving remote services or, say iOS or Android apps.
(GET,POST,PUT,DELETE) /api/v1/content/...
- Provides ability to create, retrieve, update and delete content
(GET,POST,PUT,DELETE) /api/v1/category/...
- Provides ability to create, retrieve, update and delete categories
Also,
/api/v1/user/login/(username)/(password)
/api/v1/user/logout/(username)/(joomlasessionid)
/api/v1/user/profile
/api/slim/routes
and more...
Additional information on available methods can be found here:
http://learn.getcapi.org/api-methods
It should go without saying that all cAPI Core package improves are included in the annual subscription fee. Add-ons are (will be) billed and supported separately. Now listed in the Joomla Extensions Directory (JED) https://extensions.joomla.org/extensions/extension/capi-core-rest-api.
Update 2016-03-28
As of cAPI v1.2.1 new methods have been added to allow CRUD for Joomla user and group management. In addition, I am working on a sandbox cluster at http://getcapi.io to allow potential customers to fully test out the APIs capabilities before subscribing.
Update 2016-09-18
As of cAPI v1.2.5 new methods have been added to allow CRUD actions on API tokens. The API has also been updated with doc-blocks which can auto-generate a Swagger.json. cAPI includes both a back-end and front-end view for accessing the complete API docs generated by Swagger UI.
Finally, https://getcapi.io along with demo1.getcapi.io and demo2.getcapi.io are now live and allow visitors to test the API docs. Soon, they will be configured to auto-reset so that accounts can be distributed to customers so they may fully test the API on their own.
I would recommend jBackend for this.
Further details are discussed at https://joomla.stackexchange.com/questions/10306/creating-an-api-for-a-joomla-extension/10307#10307
You might find this helpful Create Your First RESTful Web Service For Joomla! 3 With Lumen - Introduction

Google Plus API Nuget Package

I need to create posts, etc through my ASP.NET MVC 4 application.
Does anyone know decent library for Google Plus API? (Preferable as a NuGet package).
There is currently no publicly documented API that lets you automatically post to your Google+ page or stream.
There is an API that HootSuite is currently using that is slowly opening up to other vendors. See https://plus.google.com/u/0/104946722942277428266/posts/LUi2ZNyRHag for more information about what is coming and how you can sign up to request access to this. This is expected to allow you to post to a Google+ Page.
There is also the "Google+ History API" that is currently in developer preview which will allow you to create moments for a user, but they would need to manually share these moments on their stream if they choose to do so. See https://developers.google.com/+/history/ for further details.

GUI frontend for cURL for testing an API [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm (manually) testing a RESTful API that makes full use of GET/POST/PUT/DELETE methods. Rather than using cURL on the command line to quickly test different input options, it would be handy if there were a windows GUI application to make this easier. Does anything like that exist?
Use Poster with Firefox.
I know this post is a bit old, but Dev HTTP Client for Chrome is by far the best plugin I've found.
Along with providing a nice UI that pretty formats responses (like JSON and XML), it allows you to save any requests. IMHO, the best feature is the ability to set different "contexts" and set variables. For instance, you can have a "production" and "dev" context, each with a "host" variable. Then your request string could be http://${host}/foo.
Insomnia is a beautiful desktop application for Windows, Mac and Linux for debugging restful APIs (my personal favourite)
Postman is a Chrome extension for API testing and doing custom http requests. You can save requests for later use, setup different environments (staging, deployment) and collaborate and share requests with others on your team.
HttpRequester for Firefox is similar to Postman.
I like RESTclient. It doesn't format HTML, though (I assume Poster does), so if you get a 500 error you get to dredge through the return text yourself.
Found a useful (free) web tool for this that now exists!
https://curlbuilder.com/
Also XHR POSTER with Chrome
I would say has a better UI then Poster.
Update
XHR has been giving me problems. DHC by Restlet for Chrome is pretty nice also.
Fiddler is a very good tool. You can see history of requests, supports all HTTP verbs, completes the request with necessary headers (like Content-Length). The feature you are looking for is called "Request Builder".
In the interest of trying to keep this list up to date, here is an even better, newer Chrome extension: Advanced REST Client
Try gURL: http://code.google.com/p/gurl/
This is a simple HTTP-request generator, based on curl
Out of all the Firefox extensions I tried, HttpRequester is the best tool for me. It is very clear and doesn't lack a feature.
For Chrome, I would recommend Advanced REST client or Postman.
Paw for OS X is pretty nice. $29.99 as of this writing.
I think Hurl is a great candidate for that?