Skip to content

Instantly share code, notes, and snippets.

@damaneice
Last active January 29, 2024 21:03
Show Gist options
  • Save damaneice/a2aa8b19e698876ed37626a6b7b861ff to your computer and use it in GitHub Desktop.
Save damaneice/a2aa8b19e698876ed37626a6b7b861ff to your computer and use it in GitHub Desktop.
How to deliver GitHub Education benefits to your students

Hello! This documentation has been deprecated - you can find the updated documentation at https://gist.github.com/jen-k/73e5dae57526ecf73d8475e2f59a3f9a

Deprecated documentation

How to deliver GitHub Education benefits to your students

Students at your school can quickly claim their GitHub Education benefits by visiting a unique web address. By visiting that address, GitHub will verify the student's academic status with your school and instantly deliver their benefits to them.

Your school can create a unique web address for each student by including three things in it:

  1. school_id: Your school’s unique identifier, provided by GitHub.

  2. student_id: The individual student’s unique identifier, defined by your school.

  3. signature: A code used to authenticate the message, produced by your school using an algorithm (instructions below).

Used together, your school can deliver each student a unique web address that looks something like this:

https://education.github.com/student/verify?school_id=1&student_id=1&signature=b89099fdb8a24b0e2ef8ab0de893bb9408392cbf84e8fb9186adb84a920c536c

How to produce each student’s ‘signature’

The algorithm you’ll use to create each student’s signature requires the aforementioned school_id and student_id, as well as an additional GitHub-provided secret_key.

The algorithm requires that each of these values be passed as strings -- not numerals.

Here, for example, is how you can then produce a student’s signature using Ruby:

signature = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), secret_key, school_id + student_id)

What students should expect

When a student receives their unique web address from your school, they can visit that address in any web browser. If they are already signed into GitHub on that browser, they’ll see a GitHub Education web page confirming that they’ve been verified.

screen shot 2018-07-09 at 10 11 02 am

If they’re not yet signed in, the student will simply be asked to sign in before seeing the confirmation web page.

@karlhorky
Copy link

Awesome, nice one @van100j!

@pensierinmusica
Copy link

@damaneice it seems like the school_id can't contain certain characters (e.g. "%"). This took us quite a while to debug.

Could you please update the documentation to say exactly what format is allowed for the student ID? It'd be important.

For example, what is the max length, the minimum length, and the characters allowed.

Thanks!

@jen-k
Copy link

jen-k commented Apr 21, 2020

Hey @pensierinmusica,

@damaneice is no longer on this project, but I'll ping another engineer on the team to see if I can determine the invalid characters. We're short-staffed at the moment, but we'll get this updated! Thanks!

@karlhorky
Copy link

@jen-k Re: validation, in case the team would want to co-maintain / take over the URL generator repo I created (and add the validation rules there in Ruby + JavaScript + Shell code), here is a link:

https://github.com/upleveled/github-education-generate-student-url

@pensierinmusica
Copy link

pensierinmusica commented May 3, 2020

@jen-k awesome, thx! 🙂

@RomainDelamare
Copy link

RomainDelamare commented Jun 22, 2020

If someone need in C#

var userId = ...;
var schoolId = ...;
var secret = ...;
var githubUrl = "https://education.github.com/student/verify?school_id={0}&student_id={1}&signature={2}";

byte[] keyByte = new ASCIIEncoding().GetBytes(secret);
byte[] messageBytes = new ASCIIEncoding().GetBytes(string.Concat(schoolId, userId));
byte[] hashmessage = new HMACSHA256(keyByte).ComputeHash(messageBytes);

StringBuilder hex = new StringBuilder(hashmessage.Length * 2);
foreach (byte b in hashmessage)
{
    hex.AppendFormat("{0:x2}", b);
}

var signature =  hex.ToString();
var url = string.Format(githubUrl, schoolId, userId, signature);

@jasicarose75
Copy link

thanks

@W1zarDddD
Copy link

W1zarDddD commented Jan 24, 2024

Provide students with invites to the GitHub Classroom organization. Train them to use Git and GitHub for collaborative development. I personally found dissertation topics in one invite, but they had already been sorted out, I had to use https://papersowl.com/blog/ideas-for-dissertation-topics for help. In general, you can come up with a lot of things to interest students. All this will provide students with access to powerful development and learning tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment