Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements for Moodle Provider #533

Merged
merged 13 commits into from
Mar 28, 2021
Merged
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ If a provider you're looking for does not exist, consider making a PR to add one
| LinkedIn | [![NuGet](https://buildstats.info/nuget/AspNet.Security.OAuth.LinkedIn?includePreReleases=false)](https://www.nuget.org/packages/AspNet.Security.OAuth.LinkedIn/ "Download AspNet.Security.OAuth.LinkedIn from NuGet.org") | [![MyGet](https://buildstats.info/myget/aspnet-contrib/AspNet.Security.OAuth.LinkedIn?includePreReleases=true)](https://www.myget.org/feed/aspnet-contrib/package/nuget/AspNet.Security.OAuth.LinkedIn "Download AspNet.Security.OAuth.LinkedIn from MyGet.org") | [Documentation](https://docs.microsoft.com/en-us/linkedin/shared/authentication/authentication "LinkedIn developer documentation") |
| MailChimp | [![NuGet](https://buildstats.info/nuget/AspNet.Security.OAuth.MailChimp?includePreReleases=false)](https://www.nuget.org/packages/AspNet.Security.OAuth.MailChimp/ "Download AspNet.Security.OAuth.MailChimp from NuGet.org") | [![MyGet](https://buildstats.info/myget/aspnet-contrib/AspNet.Security.OAuth.MailChimp?includePreReleases=true)](https://www.myget.org/feed/aspnet-contrib/package/nuget/AspNet.Security.OAuth.MailChimp "Download AspNet.Security.OAuth.MailChimp from MyGet.org") | [Documentation](https://developer.mailchimp.com/documentation/mailchimp/guides/how-to-use-oauth2/ "MailChimp developer documentation") |
| MailRu | [![NuGet](https://buildstats.info/nuget/AspNet.Security.OAuth.MailRu?includePreReleases=false)](https://www.nuget.org/packages/AspNet.Security.OAuth.MailRu/ "Download AspNet.Security.OAuth.MailRu from NuGet.org") | [![MyGet](https://buildstats.info/myget/aspnet-contrib/AspNet.Security.OAuth.MailRu?includePreReleases=true)](https://www.myget.org/feed/aspnet-contrib/package/nuget/AspNet.Security.OAuth.MailRu "Download AspNet.Security.OAuth.MailRu from MyGet.org") | [Documentation](https://o2.mail.ru/docs#web "MailRu developer documentation") |
| Moodle | [![NuGet](https://buildstats.info/nuget/AspNet.Security.OAuth.Moodle?includePreReleases=false)](https://www.nuget.org/packages/AspNet.Security.OAuth.Moodle/ "Download AspNet.Security.OAuth.Moodle from NuGet.org") | [![MyGet](https://buildstats.info/myget/aspnet-contrib/AspNet.Security.OAuth.Moodle?includePreReleases=true)](https://www.myget.org/feed/aspnet-contrib/package/nuget/AspNet.Security.OAuth.Moodle "Download AspNet.Security.OAuth.Moodle from MyGet.org") | [Documentation](https://github.com/projectestac/moodle-local_oauth "Moodle OAuth2 plugin developer documentation") |
| Moodle | [![NuGet](https://buildstats.info/nuget/AspNet.Security.OAuth.Moodle?includePreReleases=false)](https://www.nuget.org/packages/AspNet.Security.OAuth.Moodle/ "Download AspNet.Security.OAuth.Moodle from NuGet.org") | [![MyGet](https://buildstats.info/myget/aspnet-contrib/AspNet.Security.OAuth.Moodle?includePreReleases=true)](https://www.myget.org/feed/aspnet-contrib/package/nuget/AspNet.Security.OAuth.Moodle "Download AspNet.Security.OAuth.Moodle from MyGet.org") | [Documentation](https://github.com/HIT-ReFreSH/moodle-local_oauth "Moodle OAuth2 plugin developer documentation") |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure it's stopped being maintained? Maybe they've just had no need to update it in the last few months?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repo have no update for 9 months, and another pull request opened for months too. I'm not sure it's stopped being maintained or not(maybe they're just too busy?), but since we'll be working on Moodle for a long term, HIT-ReFreSH/moodle-local_oauth will be alive for long.
However, I also created a Pull Request to projectestac/moodle-local_oauth, which contains the doc fitted to the actual performance of the plugin.
I don't know when it'll be closed, but if required, it's OK to change ReFreSH/moodle-local_oauth BACK to projectestac/moodle-local_oauth.

| Myob | [![NuGet](https://buildstats.info/nuget/AspNet.Security.OAuth.Myob?includePreReleases=false)](https://www.nuget.org/packages/AspNet.Security.OAuth.Myob/ "Download AspNet.Security.OAuth.Myob from NuGet.org") | [![MyGet](https://buildstats.info/myget/aspnet-contrib/AspNet.Security.OAuth.Myob?includePreReleases=true)](https://www.myget.org/feed/aspnet-contrib/package/nuget/AspNet.Security.OAuth.Myob "Download AspNet.Security.OAuth.Myob from MyGet.org") | [Documentation](https://developer.myob.com/api/accountright/api-overview/authentication/ "Myob developer documentation") |
| NetEase | [![NuGet](https://buildstats.info/nuget/AspNet.Security.OAuth.NetEase?includePreReleases=false)](https://www.nuget.org/packages/AspNet.Security.OAuth.NetEase/ "Download AspNet.Security.OAuth.NetEase from NuGet.org") | [![MyGet](https://buildstats.info/myget/aspnet-contrib/AspNet.Security.OAuth.NetEase?includePreReleases=true)](https://www.myget.org/feed/aspnet-contrib/package/nuget/AspNet.Security.OAuth.NetEase "Download AspNet.Security.OAuth.NetEase from MyGet.org") | [Documentation](https://reg.163.com/help/help_oauth2.html "NetEase developer documentation") |
| Nextcloud | [![NuGet](https://buildstats.info/nuget/AspNet.Security.OAuth.Nextcloud?includePreReleases=false)](https://www.nuget.org/packages/AspNet.Security.OAuth.Nextcloud/ "Download AspNet.Security.OAuth.Nextcloud from NuGet.org") | [![MyGet](https://buildstats.info/myget/aspnet-contrib/AspNet.Security.OAuth.Nextcloud?includePreReleases=true)](https://www.myget.org/feed/aspnet-contrib/package/nuget/AspNet.Security.OAuth.Nextcloud "Download AspNet.Security.OAuth.Nextcloud from MyGet.org") | [Documentation](https://docs.nextcloud.com/server/14/admin_manual/configuration_server/oauth2.html "Nextcloud developer documentation") [User EndPoint Documentation](https://docs.nextcloud.com/server/15/developer_manual/client_apis/OCS/index.html#user-metadata "Nextcloud developer documentation") |
Expand Down
2 changes: 1 addition & 1 deletion docs/moodle.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Integrating the Moodle Provider

Applies to the Moodle plugin [projectestac/moodle-local_oauth](https://github.com/projectestac/moodle-local_oauth).
Applies to the Moodle plugin [HIT-ReFreSH/moodle-local_oauth](https://github.com/HIT-ReFreSH/moodle-local_oauth).

## Example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public static class Claims
public const string IdNumber = "urn:moodle:idnumber";
public const string MoodleId = "urn:moodle:id";
public const string Language = "urn:moodle:lang";
public const string Description = "urn:moodle:desc";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ public MoodleAuthenticationOptions()
ClaimActions.MapJsonKey(ClaimTypes.MobilePhone, "phone1");
ClaimActions.MapJsonKey(ClaimTypes.GivenName, "firstname");
ClaimActions.MapJsonKey(ClaimTypes.Surname, "lastname");
ClaimActions.MapJsonKey(ClaimTypes.AuthenticationMethod, "auth");
FerdinandSu marked this conversation as resolved.
Show resolved Hide resolved
ClaimActions.MapJsonKey(ClaimTypes.Country, "country");
ClaimActions.MapJsonKey(Claims.IdNumber, "idnumber");
ClaimActions.MapJsonKey(Claims.MoodleId, "id");
ClaimActions.MapJsonKey(Claims.Language, "lang");
ClaimActions.MapJsonKey(Claims.Description, "description");
}

/// <summary>
Expand Down
8 changes: 4 additions & 4 deletions test/AspNet.Security.OAuth.Providers.Tests/Moodle/bundle.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://raw.githubusercontent.com/justeat/httpclient-interception/master/src/HttpClientInterception/Bundles/http-request-bundle-schema.json",
"items": [
{
"comment": "https://github.com/projectestac/moodle-local_oauth",
"comment": "https://github.com/HIT-ReFreSH/moodle-local_oauth",
"uri": "https://moodle.local/local/oauth/token.php",
"method": "POST",
"contentFormat": "json",
Expand All @@ -15,7 +15,7 @@
}
},
{
"comment": "https://github.com/projectestac/moodle-local_oauth",
"comment": "https://github.com/HIT-ReFreSH/moodle-local_oauth",
"uri": "https://moodle.local/local/oauth/user_info.php",
"contentFormat": "json",
"contentJson": {
Expand All @@ -30,7 +30,7 @@
}
},
{
"comment": "https://github.com/projectestac/moodle-local_oauth",
"comment": "https://github.com/HIT-ReFreSH/moodle-local_oauth",
"uri": "https://zh.moodle.local/local/oauth/token.php",
"method": "POST",
"contentFormat": "json",
Expand All @@ -43,7 +43,7 @@
}
},
{
"comment": "https://github.com/projectestac/moodle-local_oauth",
"comment": "https://github.com/HIT-ReFreSH/moodle-local_oauth",
"uri": "https://zh.moodle.local/local/oauth/user_info.php",
"contentFormat": "json",
"contentJson": {
Expand Down