EzDevInfo.com

accounts interview questions

Top accounts frequently asked interview questions

How to bundle the Azure accounts included in our MS VS Licenses

Our company has until bought a lot VS Pro/Premium and Ultimate Licenses, and each includes a free Azure Account. At the Azure Info day we have been told the best way would be to bundle them into one big account (there is just too much overhead if every developer here would register that account on his own).

Do you know how to do this ? Is there a special account manager we should contact ?

Thanks in advance, Mathias Held


Source: (StackOverflow)

Prevent users from starting multiple accounts?

I know that in the end it, can't be done.

But, what are the options to:

  a) limit the options for persons to create multiple accounts,
  b) increase the chance of detecting multiple accounts / person

for a blog-like web service?
(people can sign up for their own blog)

Update:
I think the 'limit the options' has been answered nicely. (there is no reliable method, but we can raise the bar)
However, I would still like to know what other options there are to detect multiple accounts?


Source: (StackOverflow)

Advertisements

Show settings under accounts & sync menu for android app

I am implementing a syncadapter for an android app and would like to make the settings for the account available under the "Accounts & sync" menu. I have seen this done in the DropBox app(as shown below), but I have not been able to find documentation on how to do this. I have the accounted added, just want to add a link to the account settings in this menu.

enter image description here


Source: (StackOverflow)

List supported authorites for selected accounts

I'm trying to develop an application which syncs only selected accounts using ContentResolver.requestSync(account, authority, extras);.

I was able to sync contacts and calendar by using com.android.contacts and com.android.calendar respectively as authority.

But, is there any way to get the list of authorities supported by a specific account?

Also, what is the effect of using null as authority?


Source: (StackOverflow)

Permissions Not Working

I've been having some odd problems with permission in Android. I am trying to just get a list of the google calendars a particular user has, but first I need to let them pick the account.

I included this line in my manifest:

<uses-permission android:name="android.permission.GET_ACCOUNTS"></uses-permission>

However I get this error:

12-26 03:26:31.004 13841 13841 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{....}: java.lang.SecurityException: caller uid 10105 lacks any of android.permission.GET_ACCOUNTS

I had tried something similar with gaining access to the undocumented Calendar API with READ_CALENDAR and WRITE_CALENDAR, but I had similar exceptions (although probably for different reasons - I thought it might be worth mentioning in case it wasn't).

Please clue me in on what I'm doing wrong!

Thanks!


Source: (StackOverflow)

Why doesn't my android custom account show in "Accounts and Settings"?

I have implemented a custom account for an app I'm working on. Here is my authenticator.xml:

<?xml version="1.0" encoding="utf-8"?>
<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
    android:accountType="MyApp"
    android:icon="@drawable/logo"
    android:smallIcon="@drawable/logo"
    android:label="MyApp"
    android:accountPreferences="@xml/account_preferences" />

I can add the account using the Android setting's "Add Account" feature, and my app can use all the account's information. However the account doesn't ever show in the list with my Google, Twitter, Faceboock, etc. accounts.


Source: (StackOverflow)

SyncAdapter not being called depending on order of Account setup calls

I've come across some slightly odd behaviour with my SyncAdapter.

The first time I install my app (after uninstalling with adb), it launches and creates an account. Depending on the ordering of some statements (see below), my SyncAdapter's onPerformSync() will never be called; my account under "Accounts and sync" shows the "sync in progress" icon spinning indefinitely. If I then uncheck the sync checkbox next to my app's account, and then recheck it, my onPerformSync() is called immediately.

This causes my SyncAdapter to never be called. "sync in progress" icon spins forever, unless I uncheck, then recheck the sync checkbox:

final Account account = new Account(mUsername, getString(R.string.ACCOUNT_TYPE));
mAccountManager.addAccountExplicitly(account, mPassword, null);
ContentResolver.setSyncAutomatically(account, getString(R.string.CONTENT_AUTHORITY), true);
ContentResolver.setIsSyncable(account, getString(R.string.CONTENT_AUTHORITY), 1);

With this ordering of the same statements, everything works perfectly:

final Account account = new Account(mUsername, getString(R.string.ACCOUNT_TYPE));
ContentResolver.setSyncAutomatically(account, getString(R.string.CONTENT_AUTHORITY), true);
ContentResolver.setIsSyncable(account, getString(R.string.CONTENT_AUTHORITY), 1);
mAccountManager.addAccountExplicitly(account, mPassword, null);

My guess is I'm putting the SyncManager into some inconsistent state due to it firing off a sync request instantly on account creation, and I'm changing its config under its feet. But the (barely coherent) documentation doesn't mention any issues with calling these functions whenever you like.

As an aside for others struggling with SyncAdapters, I found that contentResolver.requestSync() will never trigger your SyncAdapter.onPerformSync() unless you call ContentResolver.setIsSyncable(account, getString(R.string.CONTENT_AUTHORITY), 1);.

Could someone explain this behaviour? The documentation surrounding Accounts and Syncing is somewhat unclear to say the least.

I'm getting this behaviour on the 2.1 Emulator, compiling against the 2.1 SDK.


Source: (StackOverflow)

Google Sign-In, Database Side

I've read about using Google to handle sign-ins from this website, but it doesn't explain very much about what should be going on with the database.

Normally for user accounts in a database you'd have fields like id, username, password, etc. From what I read in the link, you will eventually get the ID token for a user, and inside is a key called "sub" that has a value in it that you can use to identify the user.

My question is, where would this "sub" be stored in the database? Would it go in the id field? Username field?

I think it shouldn't go in the username field since there's the possibility that someone creates a username that is exactly the same as someone's Google sub id. But it also seems weird to put it in the id field.

Also, would there need to be another field in the user accounts table that is a boolean in order to differentiate between users signed in natively and users signed in through Google?


Source: (StackOverflow)

Adding a Facebook app administrator who is not a friend

Having searched through this section many times, I am struggling to find an answer to what I thought would be simple:

Having created an app, I cannot add other facebook verified developer accounts as administrators of the app without first friending them.

This is a professional app (we are using it to provide login through Facebook services), and I cannot find a way to add other colleagues without making them into facebook friends.

I have tried:

Roles > Administrators > Add:

  • Email address
  • UID
  • Link to Profile URI
  • Name search

I either get back nothing, or a notice that the user is not a facebook user (though they patently are, I can add them as a friend after all).


Source: (StackOverflow)

requestAccessToAccountsWithType completion not being called

When I run [_accountStore requestAccessToAccountsWithType: ...] I am getting no response. My completion handler isn't being called. However I do have access to twitter.

    //  Step 0: Check that the user has local Twitter accounts
    if ([SLComposeViewController
     isAvailableForServiceType:SLServiceTypeTwitter]) {
        NSLog(@"OH YES!!!");
        //  Step 1:  Obtain access to the user's Twitter accounts
        ACAccountType *twitterAccountType = [_accountStore accountTypeWithAccountTypeIdentifier: ACAccountTypeIdentifierTwitter];
        NSLog(@"OH YES!!!");

        [_accountStore requestAccessToAccountsWithType:twitterAccountType options:nil
                                       completion:^(BOOL granted, NSError *error)
        {
            NSLog(@"Im in!");
            if (granted == YES)
            {
                NSArray *arrayOfAccounts = [_accountStore
                                            accountsWithAccountType:twitterAccountType];

                if ([arrayOfAccounts count] > 0)
                {
                    ACAccount *twitterAccount = [arrayOfAccounts lastObject];

                    NSLog(@"%@", twitterAccount.userFullName);
                    NSLog(@"%@", twitterAccount.username);
                    NSLog(@"%@", twitterAccount.credential);
                    NSLog(@"%@", twitterAccount.identifier);

                }
            }else{
                NSLog(@"Failed muahahaha");
            }
        }];
    }

Why is this happening?


Source: (StackOverflow)

Multiple custom accounts in combination with GCMIntentService

I encountered a problem with having multiple accounts of my own custom type.
I use GCM (Google Cloud Messaging) to recieve messages from our application server. Now since you need to make your own implementation of GCMIntentService extending GCMBaseIntentService, you need to override onRegistered(Context context, String regId) , the problem here lies in that I want to send saved data on the account (an auth token) to our application server in that method. So that the application server knows which device/registration id belongs to a certain account in our own database.

How am I going to find out for which account I just registered to GCM with inside the onRegistered() method? (I couldn't find any similar question =( )


Source: (StackOverflow)

Powershell Listing inactive accounts

I am trying to list all accounts that have not been logged into outside of 6 months.

This is my first time really using powershell and I am simply editing other people's scripts at this point to fit my own needs.

I want to separate the search into two lists : computers only and users only.

Code for computers outside six months.

Search-ADAccount -accountinactive -computersonly | where {$_.lastlogondate -lt (get-date).addmonths(-6)} | FT Name,LastLogonDate

Code for users outside six months.

Search-ADAccount -accountinactive -usersonly | where {$_.lastlogondate -lt (get-date).addmonths(-6)} | FT Name,LastLogonDate

However, these are not working and are just spitting out all accounts. I have also noticed changing the -6 to any number really has no effect. Suggestions?


Source: (StackOverflow)

Handling logins from multiple third-party APIs

I need to implement an accounts system that lets users login via the Facebook, Twitter and LinkedIn APIs. I'm looking for the most simplest and most efficient way to do this on the backend, using MySQL and PHP. Here's what I have in mind as a starting point:

First, I would create two database schemas.

  • users (id, name, password hash)
  • thirdPartyLogins (userId, serviceName, token)

Then, I would run the following query to fetch a user's record using the token provided by a third-party API.

SELECT * FROM users, thirdPartyLogins
WHERE serviceName = $serviceName 
AND token = $token
AND thirdPartyLogins.userID = users.id
LIMIT 1

Is this an efficient way to handle the third-party logins? Would you suggest any tweaks (or existing frameworks) for expediting development of such an accounts system?

Thanks in advance for sharing your wisdom.


Source: (StackOverflow)

Add application name with Twitter and Accounts frameworks

I'm developing a little Twitter application on iOS 5. I'm using Twitter and Accounts frameworks so I login in with an ACAccount and send tweets with TWRequest.

When I send a tweet, on its details, I see "via iOS". Can I set (via Twitter API or iOS frameworks) a name of application to see something like "via MyApp"?

I know that is automatically set if I authenticate via OAuth with my app consumer keys and so on, but this is not the case because I authenticate via ACAccount.

Thank you.


Source: (StackOverflow)

Android AccountManager accounts storage

Where are the AccountManager Accounts stored? Is it on the device? If yes in which folder is it stored?


Source: (StackOverflow)