I was wondering how I could link my application to kraken.com server.
For example, making a login activity that sends the username and password to the server and if it's correct, open another activity.
The kraken's API is given by the following link: https://www.kraken.com/help/api
The problem is that I don't know how this API exactly works. How can I make HTTP Request and what is json? Consider I'm new in this area (API).
So firstly, JSON stand for Javascript Object Notation, it's a syntax for exchanging or storing data.
I'm assuming you're using Java since you're using Android Studio.
Looking at Kraken's API page: https://www.kraken.com/help/api#example-api-code
They don't currently have support a 3rd party Java Library for API access. So you would be looking a using a RESTful approach.
Here is an example of how to use that approach in Java: https://www.mkyong.com/webservices/jax-rs/restfull-java-client-with-java-net-url/
Related
I'm trying to teach myself about integrating systems via WebHooks.
In a free/hosted GIS system, I can create a WebHook that would, in theory, POST a JSON object to an external system.
The problem is, I don't have an external system that's available right now for for receiving the POST.
I think I need some sort of publicly available sample server that would:
Receive the POST requests
Do something with the requests (ie. create some sort of record)
...so that I could determine if the WebHook worked correctly or not.
How can I test my WebHooks without having an on-premise external system?
I've poked around websites like Postman Echo and Amazon Lambda. But to my untrained eye, it seems like they're not quite designed for what I need.
You could use any of these options depending on your requirements:
You could use webhooks modules in services like Integromat or Zapier to receive webhook data and then apply transformation.
You could deploy a script on heroku and use the URL generated there to send the webhooks calls.
You could also use services like requestbin, webhook.site etc if you just want to receive webhooks data.
Regards
I am trying to work out an application using
Dotnet Core 1.0
MySQL as the data store
Authetication and Authorization
Entity Framework
Ubuntu 16 machine
I have succeeded in creating a sample API to fetch data from MySQL database using entity framework. Now I want to introduce Authentication using email as username and Password.
I tried several method from different blogs but unable to achieve this.
What I am trying to achieve is Custom Authentication for the api where user will send username and password to login Api. The login Api will return an access token and refresh token. Using this access token, the user can call other APIs.
Later on I want to add Google and Facebook Authentication too.
Is there a way to do this?
Everything you want to achieve is possible. However there are some caveats.
Yes you can do this. You will need to use the resource owner grant which is turned off in identityserver 4 by default. I suspect the reason for this is because passing user credentials into an application is an anti-pattern, it is there to typically support legacy systems, also it does not authenticate users in the explicit sense because the credentials could come from an un-trusted source (as an example). You can read up about the grant's generic value here. You can find samples here.
The safer pattern is to use something like Implicit Flow which is good practice if you cannot guarantee trust between clients and your API.
As for social logins this is possible. There are tonnes of samples online but here are the official docs.
There is a project on github, https://github.com/diogodamiani/IdentityServer4.MongoDB and a corresponding nuget package that will send you in the right direction. It's obviously MongoDb, but the same premise applies.
I have two things. A backend running on App Engine and a Android app. These needs to communicate in a efficient way.
What I already did. I created a api with Google Cloud Endpoints. This endpoint exposes calls. The objects in the backend are mapped to json and mapped back to objects in the Android app. This is what the Endpoints provide.
Sometimes I want to push information from the backend to the Android app. What I do now is I send a Google Cloud Message (GCM) to the Android app and these is updating everything by calling something on the Endpoint of the backend.
This situation is working without problems but it has some drawbacks:
When I update a lot of devices at ones (what is happening a lot in my application) all those devices make a call to the backend and creating a large peak load.
The extra call is using additional battery on the phones.
What I want is to add the updated information into the GCM. GCM has support to add 4kB of data. Large enough to add the json with the updated information. If I want to send more then 4kB I can always use the old situation.
So, basicly what I want is the following:
When I'm going to send a GCM I retrieve the the correct objects from datastore/database.
Those objects needs to be converted to json in the same way as the Endpoint library does.
The json should be added to the GCM.
In the Android application the json should be convert back to objects in the same way as the Endpoint library does.
Continue processing those object the same way as before.
I found a thread that suggested that I should the gson library to do this. But I have problems in both backend and Android app. And also the json itself is not the same. I want to use the Endpoint library to serialize the same json and to deserialize to the same result as a Endpoint call.
Does anybody have any idea how to do that? Maybe a example or tutorial?
Once I have created my Web App with Zend2 , zfcUser and bjyAuthorize it's time to create the mobile App.
Our approach is to create and app with a json interaction with the Zend2 background.
The problem is that I don't know where to start in order to deal with a jSon Auth. Is possible wit zfcUser? any example out there?
Thanks in advance
ZfcUser module provides support for additional authentication mechanisms via plugins (Google, Facebook, LDAP, etc), but this feature seems to be in development now.
If you need that your mobile application to authenticate through some custom protocol based on JSON format, all you have to do is to create a controller action (say, mobileAuthAction()) which takes a JSON array with user credentials from POST, uses zfcUser API to authenticate the user, and return the response in JSON format. You may also look at view_manager configuration key to adjust the rendering strategy for your action to allow it to return JSON. Alternatively, you may call the $viewModel->setTerminal(false) to disable the layout rendering and echo your JSON to standard output.
I need to be able to consume some JSON data in a POST request from another web app. I have tried looking at the various methods on the Request class, but nothing seems to give me the JSON I need.
Using Request.Form will not work, since it is not coming from a form, but another web app. The content type is application/json, and from examining the whole HTTP request, I know the JSON is in there. What is the best way to get at this JSON data?
Note: I am working from within an action on a controller.
I think you can get your JSON from your model parameter inside the Action of the Controller. Check out this article that explains a bit of what I mean.
You can also read this one for reference
Since you are consuming data from another web app I would use a REST web service instead of a controller in an MVC application. You cans use the ASP.NET Web API which makes it easy to setup a REST web API and it is tightly integrated in with MVC 4, which is now in Beta. If the communication is cross domain (i.e. different servers and/or ports) you will need to use JSONP. You can go to this StackOverflow QA for directions on how to use JSONP with Web API.