Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 523275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:26:27+00:00 2026-05-13T08:26:27+00:00

Hey guys I am using open id authentication on my website and after authenticating

  • 0

Hey guys I am using open id authentication on my website and after authenticating I am getting a url from openid providers i.e yahoo and google

http://www.mysite.com/openid-login.php?
openid.identity=https://me.yahoo.com/a/1234567&
openid.ax.value.nickname=john&
openid.ax.value.email=john@yahoo.co.in&


http://www.mysite.com/openid-login.php?
openid.identity=https://www.google.com/accounts/o8/1234567&
openid.ext1.value.email=kevin@gmail.com&
openid.ext1.value.country=IN

I have trimmed the urls a bit for clarity. I would like to create a single function for both that can set the email(if exists), nickname(if exits), identity(openid ina ) in an array and return the values. eg.

function userdetails(array_get){
......
......
return $userdetails;
}
$userdetails =userdetails($_GET);

$userdetails[‘nickname’] would give me the nickname if exists and similarly for the email and identity. Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:26:28+00:00Added an answer on May 13, 2026 at 8:26 am

    I did not create this function nor take credit for it. This was pulled and modified from the Simple OpenID library. If somebody has a link please post it in the comments as I don’t have access to the original source.

    /**
     * Method to filter through $_GET array for requested user information.
     * Will return an array of trimmed userinfo.
     */
    public function filterUserInfo($arr_get) {
        $valid_ax_types = array('nickname' => 1, 'email' => 1, 'fullname' => 1, 'dob' => 1, 'gender' => 1, 'postcode' => 1, 'country' => 1, 'language' => 1, 'timezone' => 1, 'firstname' => 1, 'lastname' => 1);
        $userinfo = array();
        foreach ($arr_get as $key => $value) {
            // trim the key
            $trimmed_key = substr($key, strrpos($key, "_") + 1);
    
            // check for valid openid_ext1 values
            if (stristr($key, 'openid_ext1_value') && isset($value[1])) {
                $userinfo[$trimmed_key] = $value;
            }
    
            // check for valid openid_ax values
            if (stristr($key, 'openid_ax_value') && isset($value[1])) {
                $userinfo[$trimmed_key] = $value;
            }
    
            // check for valid sreg_ values
            else if (stristr($key, 'sreg_') && array_key_exists($trimmed_key, $arr_ax_types)) {
                $userinfo[$trimmed_key] = $value;
            }
        }
        return $userinfo;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys, first off all sorry, i can't login using my yahoo provider. anyways
Hey guys using POSIX API system calls read , write , open , etc.
Hey guys I've been using the has_and_belongs_to_many relationship with checkboxes example from the Railscast
Hey guys i'm using this plugin from Hawkee. Its like twitter where you can
Hey guys, I'm using Twitter's PHP API, called twitterlibphp , and it works well,
Hey Guys I am in the process of learning JQuery and I started using
Hey guys I have one more question lol. I am using a script that
Hey Guys, here is my code for this, the only help i get from
Hey guys. We're using OSGi services in an Eclipse RCP application. To track them,
Hey guys I'm using the latest version of XCode (3.2.2) and I've linked the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.