MySpace Integration with iPhone - iphone

I made an iPhone application in which I have to implement myspace integration. I have created myspace application using developer.myspace.com.
And I am getting APPLICATION_SCHEME, CONSUMER_KEY & APPLICATION_ID using that application created. That I am using in my application to update status. I am not getting the following details:
(i) CONSUMER_SECRET
(ii) ACCESS_TOKEN_KEY
(iii) ACCESS_TOKEN_SECRET
(iv) PERSON_ID
And whenever I update status on myspace it is giving error 401 which means authentication failed. So, Can anyone tell me how to solve this issue?
The reference application which I have created is here.
Thanks in advance.

-->You need to register a unique URL Type within your .plist file.
--> Make sure to set the UrlScheme property of the context to the same value you are using in the .plist when you instantiate the MySpace class. This will allow the SDK to create an appropriate callback URL that will fire off your application when the user has authenticated. PLEASE DO NOT USE THE DEFAULT URLSCHEME.
-->You can check if the user is logged in by calling [mySpace isLoggedIn]
-->This checks if your app has an Access Token associated with the user for Offsite applications (Onsite applications do not need an Access Token, hence checking if they are logged in is mute).

Related

How I can auto login with SwiftyDropbox?

I have an app with SwiftyDropbox that function correctly, but I need to insert email and password for Dropbox every time that I use the app.
The app it's only for my use, it's not a security problem if the app auto-login in my account.
I don't find examples or documentation to make an auto-login with SwiftyDropbox. It's possible?
While the Dropbox API was designed with the intention that each user would link their own Dropbox account, in order to interact with their own files, it is technically possible to connect to just one account. We generally don't recommend doing so, for various technical and security reasons, but those won't apply if you're the only user anyway.
So, there are two ways to go about this:
1) Implement the normal app authorization flow as documented, and log in and authorize the app once per app installation. The SwiftyDropbox SDK will store the resulting access token for you, which you can programmatically re-use after that point each time using authorizedClient.
2) Manually retrieve an access token for your account and hard code it in to the app, using the DropboxClient constructor shown here under "Initialize with manually retrieved auth token".

Spotify iOS SDK login with access token from django-allauth

I am creating an iOS app with Spotify playback with a django backend. This is my first programming project, and I am a little hung up on oauth2. I know that I need to do the authorization code flow on the server side to obtain refreshable user tokens.
I set up django-allauth on my django project, and managed to get it working to authenticate Spotify users despite the limited documentation for Spotify. I can call localhost:8000/users/spotify/login and the code will be refreshed and a vlid access token is stored in the database (made authorized request on Postman). I believe this will work when I deploy the changes to heroku as well, I just have not yet.
Getting back to my iOS app, I am trying to use the sdk to stream songs. I start the SPTAudioStreamingController.sharedInstance() with my client ID, no problem, and then try to login with access token hard coded, with no success. I know that I am missing something, probably involving the session that is returned when authentication is handled completely through iOS. I am hoping for clarification on how to complete this implementation and log in on the SDK properly using the access tokens stored in my django backend. This is the function that attempts to set up spotify and login. It is called in the app delegate.
print("Setting up spotify")
SPTAuth.defaultInstance().clientID = "hardcodedclientID"
SPTAuth.defaultInstance().redirectURL = URL(string: "hardcodedredirectURL")
SPTAuth.defaultInstance().sessionUserDefaultsKey = "spotifySessionKey"
SPTAuth.defaultInstance().requestedScopes = [SPTAuthStreamingScope, SPTAuthUserLibraryReadScope]
do {
try SPTAudioStreamingController.sharedInstance().start(withClientId: "hardcodedclientID")
} catch {
fatalError("Couldn't start Spotify SDK")
}
print("shared instance started")
SPTAudioStreamingController.sharedInstance().login(withAccessToken: hardCodedAccessTokenFromDjango)
print(SPTAudioStreamingController.sharedInstance().loggedIn)
I have set up all the app settings I need to, per the two tutorials I followed here and here. I know that I will not be able to hard code the information like that, but I was under the impression that I should be able to login(withaccesstoken:) simply using the access token I had. I am trying to find the best practice for sending my acces token through My Django REST API and then authenticating the SDK with it.
I ended up being able to get the same code to work. I added a session variable and set it, but the main problem was that django-allauth defaulted to requesting no scopes, I changed the source code to the scopes I needed and the process went much smoother. I believe I can access my access token through my api and that will be enough to initialize everythign client side, which is wa

Using Facebook Authentication

In my Angular2 app I have used the following code:
loginfb() {
this.afAuth.auth.signInWithPopup(new firebase.auth.FacebookAuthProvider());
}
But the problem is I am getting an error App Not Set Up: This app is still in development mode, and you don't have access to it. Switch to a registered test user or ask an app admin for permissions.
So I went to Facebook developers, created an app, added the Facebook Login product, went to the product's settings and set the Valid OAuth redirect URIs with the URI given in the firebase console.
But even then when I am trying to login, I am facing the same error.
Any help would be greatly appreciated. Thanks.
This error comes when your app is not live.There are a bunch of possible things which could trigger this error.I am not sure and as you are getting error "you don't have access to it",may be you are trying to login through your test version of the Facebook app and you may have not added the user Roles as Testers in Roles section and the you have to add the email address of the Facebook account you are trying to login in setting section.
Then ,make sure that the user you added accepts the request sent before you try to test otherwise it will fail.
And for error "Switch to a registered test user or ask an app admin for permissions."
When you create new app on Facebook, its by default only visible to you and not to public and others won't be able to use it for social login and they will get this error. You may have to go to Go to your Facebook app's dashboard, Select the "Status and Review" tab and set YES or ON.
You can find similar question and answer is there in this link App Not Set Up.and
This app is still in development mode

Windows Phone Facebook app not returning access token after V 8.3.1.0 Update

I allow my windows phone app users to login using their Facebook account. To authenticate the user and get the access token, I follow the steps provided in this link. It opens up the installed Facebook app on windows phone, authenticates the user and returns an access token. This was working until Facebook recevied V 8.3.1.0 update. Now it opens up the facebook app and comes back with following error:
/Protocol?encodedLaunchUri=msft-<my_app_id>://authorize?error=&error_code=2005&error_description=Calling+app's+ID+doesn't+match+the+ID+sent+by+the+calling+app&error_reason=Calling+app's+ID+doesn't+match+the+ID+sent+by+the+calling+app&state="
What went wrong here? Any deep link changes by facebook?
Found a solution.
When we create a Windows Phone project in Visual Studio, it would assign a Product Id to our app. That Id will change once the app is published on the store.
When we define custom Uri scheme in WMAppManifest.xml file, we have to always specify the published app id. Otherwise facebook authentication would fail.
This new facebook app is expecting the calling app's product id to be same as published app id that is mentioned in the custom uri scheme. Since it won't match in our local app, it is returning the error stated above. I changed the Product id to published app id and everything works fine.
This might help if someone is facing similar issue.

facebook cross domain receiver error

I am working on a facebook app when i try to invoke js for asking extended permission from the user i got the following error
The Facebook Connect cross-domain
receiver URL
(http://[mydomain/folder]/gripsoft/xd_receiver.htm)
must have the application's Connect
URL (http://localhost:63919/) as a
prefix. You can configure the Connect
URL in the Application Settings
Editor.
Now the strange thing is that i have not specified localhost:63919 anywhere in my application settings.
Can somebody tells me which link i am missing in this whole scenario.
(Enviornment IFrame based APP using Facebook Toolkit for .NET)
I found the issue unfortunately i was using wrong Api Key and thats why it was keep referring to my other test application. Just updating that if someone else encounter the issue , you have to check both Web.Config and Master Page/Web Form where you are invoking FaceBook.Connect to make sure Api Key matches with your application key.