Skip to content

Humni/ci-github-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeIgniter Github OAuth Authentication Library

Allows CodeIgniter to let users login to GitHub and gain access to their account data and the rest of GitHubs API.

Getting Started

  1. You first need to register your application with GitHub to get your client_id and client_secret
  2. Drag and drop the files in the respective folders (e.g. config/github.php goes into the config file in the CI application)
  3. Set the config variables
  4. Create button with link generated by $this->github->generateLoginURL()
  5. Create the redirect URI page, an example of how this could look is below:
  public function github_oauth(){
    $this->load->library('github');
    $token = $this->github->getAccessToken();
    
    if($token == false){
      //something went wrong
      redirect('login','refresh');
    }

    //save token somewhere safe
    redirect('','refresh');
  }

About

Codeigniter Github OAuth Authentication Library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages