<commit_before>using System.Collections.Generic;
using IdentityServer4.Models;
using IdentityServer4;
using IdentityModel;

namespace MawAuth
{
    public class Config
    {
        // scopes define the API resources in your system
        public static IEnumerable<ApiResource> GetApiResources()
        {
            return new List<ApiResource>
            {
                new ApiResource("maw_api",
                                "APIs to access photo and video data within mikeandwan.us",
                                new [] { JwtClaimTypes.Name, JwtClaimTypes.Role })
            };
        }


        public static IEnumerable<IdentityResource> GetIdentityResources()
        {
            return new List<IdentityResource>
            {
                new IdentityResources.OpenId(),
                new IdentityResources.Profile(),
                new IdentityResources.Email(),
                new IdentityResource(JwtClaimTypes.Role, "mikeandwan.us Roles", new[] { JwtClaimTypes.Role }),
            };
        }


        // clients want to access resources (aka scopes)
        public static IEnumerable<Client> GetClients()
        {
            return new List<Client>
            {
                new Client
                {
                    ClientId = "maw_videos",
                    ClientName = "mikeandwan.us Video Application",
                    RequireConsent = false,
                    //AccessTokenLifetime = 600, // 10 minutes, default 60 minutes
                    AllowedGrantTypes = GrantTypes.Implicit,
                    AllowAccessTokensViaBrowser = true,
                    RedirectUris = new List<string>
                    {
                        "https://localhost:5021/videos/signin-oidc"
                    },
                    PostLogoutRedirectUris = new List<string>
                    {
                        "https://localhost:5021/"
                    },
                    AllowedCorsOrigins = new List<string>
                    {
                        "https://localhost:5021"
                    },
                    AllowedScopes = new List<string>
                    {
                        IdentityServerConstants.StandardScopes.OpenId,

                        // apis
                        "maw_api",

                        // identity resources
                        JwtClaimTypes.Role
                    }
                },
                new Client
                {
                    ClientId = "maw_photos",
                    ClientName = "mikeandwan.us Photo Application",
                    RequireConsent = false,
                    //AccessTokenLifetime = 600, // 10 minutes, default 60 minutes
                    AllowedGrantTypes = GrantTypes.Implicit,
                    AllowAccessTokensViaBrowser = true,
                    RedirectUris = new List<string>
                    {
                        "https://localhost:5021/photos/signin-oidc"
                    },
                    PostLogoutRedirectUris = new List<string>
                    {
                        "https://localhost:5021/"
                    },
                    AllowedCorsOrigins = new List<string>
                    {
                        "https://localhost:5021"
                    },
                    AllowedScopes = new List<string>
                    {
                        IdentityServerConstants.StandardScopes.OpenId,

                        // apis
                        "maw_api",

                        // identity resources
                        JwtClaimTypes.Role
                    }
                },
                new Client
                {
                    ClientId = "maw_photo_stats",
                    ClientName = "mikeandwan.us Photo Stats Application",
                    RequireConsent = false,
                    //AccessTokenLifetime = 600, // 10 minutes, default 60 minutes
                    AllowedGrantTypes = GrantTypes.Implicit,
                    AllowAccessTokensViaBrowser = true,
                    RedirectUris = new List<string>
                    {
                        "https://localhost:5021/photos/stats/signin-oidc"
                    },
                    PostLogoutRedirectUris = new List<string>
                    {
                        "https://localhost:5021/"
                    },
                    AllowedCorsOrigins = new List<string>
                    {
                        "https://localhost:5021"
                    },
                    AllowedScopes = new List<string>
                    {
                        IdentityServerConstants.StandardScopes.OpenId,

                        // apis
                        "maw_api",

                        // identity resources
                        JwtClaimTypes.Role
                    }
                },
                new Client
                {
                    ClientId = "maw_photos_3d",
                    ClientName = "mikeandwan.us Photo 3D Application",
                    RequireConsent = false,
                    //AccessTokenLifetime = 600, // 10 minutes, default 60 minutes
                    AllowedGrantTypes = GrantTypes.Implicit,
                    AllowAccessTokensViaBrowser = true,
                    RedirectUris = new List<string>
                    {
                        "https://localhost:5021/photos/3d/signin-oidc"
                    },
                    PostLogoutRedirectUris = new List<string>
                    {
                        "https://localhost:5021/"
                    },
                    AllowedCorsOrigins = new List<string>
                    {
                        "https://localhost:5021"
                    },
                    AllowedScopes = new List<string>
                    {
                        IdentityServerConstants.StandardScopes.OpenId,

                        // apis
                        "maw_api",

                        // identity resources
                        JwtClaimTypes.Role
                    }
                },
                new Client
                {
                    ClientId = "www.mikeandwan.us",
                    ClientName = "www.mikeandwan.us",
                    AllowedGrantTypes = GrantTypes.HybridAndClientCredentials,
                    RequireConsent = false,

                    ClientSecrets =
                    {
                        new Secret("secret".Sha256())
                    },

                    // where to redirect to after login
                    RedirectUris = { "https://localhost:5021/signin-oidc" },

                    // where to redirect to after logout
                    PostLogoutRedirectUris = { "https://localhost:5021/signout-callback-oidc" },

                    AllowedScopes = new List<string>
                    {
                        IdentityServerConstants.StandardScopes.OpenId,
                        IdentityServerConstants.StandardScopes.Profile,
                        IdentityServerConstants.StandardScopes.Email,

                        // apis
                        "maw_api",

                        // identity resources
                        JwtClaimTypes.Role
                    },
                    AllowOfflineAccess = true
                }
            };
        }
    }
}<commit_msg>add new android photos client<commit_after>using System.Collections.Generic;
using IdentityServer4.Models;
using IdentityServer4;
using IdentityModel;

namespace MawAuth
{
    public class Config
    {
        // scopes define the API resources in your system
        public static IEnumerable<ApiResource> GetApiResources()
        {
            return new List<ApiResource>
            {
                new ApiResource("maw_api",
                                "APIs to access photo and video data within mikeandwan.us",
                                new [] { JwtClaimTypes.Name, JwtClaimTypes.Role })
            };
        }


        public static IEnumerable<IdentityResource> GetIdentityResources()
        {
            return new List<IdentityResource>
            {
                new IdentityResources.OpenId(),
                new IdentityResources.Profile(),
                new IdentityResources.Email(),
                new IdentityResource(JwtClaimTypes.Role, "mikeandwan.us Roles", new[] { JwtClaimTypes.Role }),
            };
        }


        // clients want to access resources (aka scopes)
        public static IEnumerable<Client> GetClients()
        {
            return new List<Client>
            {
                new Client
                {
                    ClientId = "maw_videos",
                    ClientName = "mikeandwan.us Video Application",
                    RequireConsent = false,
                    //AccessTokenLifetime = 600, // 10 minutes, default 60 minutes
                    AllowedGrantTypes = GrantTypes.Implicit,
                    AllowAccessTokensViaBrowser = true,
                    RedirectUris = new List<string>
                    {
                        "https://localhost:5021/videos/signin-oidc"
                    },
                    PostLogoutRedirectUris = new List<string>
                    {
                        "https://localhost:5021/"
                    },
                    AllowedCorsOrigins = new List<string>
                    {
                        "https://localhost:5021"
                    },
                    AllowedScopes = new List<string>
                    {
                        IdentityServerConstants.StandardScopes.OpenId,

                        // apis
                        "maw_api",

                        // identity resources
                        JwtClaimTypes.Role
                    }
                },
                new Client
                {
                    ClientId = "maw_photos",
                    ClientName = "mikeandwan.us Photo Application",
                    RequireConsent = false,
                    //AccessTokenLifetime = 600, // 10 minutes, default 60 minutes
                    AllowedGrantTypes = GrantTypes.Implicit,
                    AllowAccessTokensViaBrowser = true,
                    RedirectUris = new List<string>
                    {
                        "https://localhost:5021/photos/signin-oidc"
                    },
                    PostLogoutRedirectUris = new List<string>
                    {
                        "https://localhost:5021/"
                    },
                    AllowedCorsOrigins = new List<string>
                    {
                        "https://localhost:5021"
                    },
                    AllowedScopes = new List<string>
                    {
                        IdentityServerConstants.StandardScopes.OpenId,

                        // apis
                        "maw_api",

                        // identity resources
                        JwtClaimTypes.Role
                    }
                },
                new Client
                {
                    ClientId = "maw_photo_stats",
                    ClientName = "mikeandwan.us Photo Stats Application",
                    RequireConsent = false,
                    //AccessTokenLifetime = 600, // 10 minutes, default 60 minutes
                    AllowedGrantTypes = GrantTypes.Implicit,
                    AllowAccessTokensViaBrowser = true,
                    RedirectUris = new List<string>
                    {
                        "https://localhost:5021/photos/stats/signin-oidc"
                    },
                    PostLogoutRedirectUris = new List<string>
                    {
                        "https://localhost:5021/"
                    },
                    AllowedCorsOrigins = new List<string>
                    {
                        "https://localhost:5021"
                    },
                    AllowedScopes = new List<string>
                    {
                        IdentityServerConstants.StandardScopes.OpenId,

                        // apis
                        "maw_api",

                        // identity resources
                        JwtClaimTypes.Role
                    }
                },
                new Client
                {
                    ClientId = "maw_photos_3d",
                    ClientName = "mikeandwan.us Photo 3D Application",
                    RequireConsent = false,
                    //AccessTokenLifetime = 600, // 10 minutes, default 60 minutes
                    AllowedGrantTypes = GrantTypes.Implicit,
                    AllowAccessTokensViaBrowser = true,
                    RedirectUris = new List<string>
                    {
                        "https://localhost:5021/photos/3d/signin-oidc"
                    },
                    PostLogoutRedirectUris = new List<string>
                    {
                        "https://localhost:5021/"
                    },
                    AllowedCorsOrigins = new List<string>
                    {
                        "https://localhost:5021"
                    },
                    AllowedScopes = new List<string>
                    {
                        IdentityServerConstants.StandardScopes.OpenId,

                        // apis
                        "maw_api",

                        // identity resources
                        JwtClaimTypes.Role
                    }
                },
                new Client
                {
                    ClientId = "www.mikeandwan.us",
                    ClientName = "www.mikeandwan.us",
                    AllowedGrantTypes = GrantTypes.HybridAndClientCredentials,
                    RequireConsent = false,

                    ClientSecrets =
                    {
                        new Secret("secret".Sha256())
                    },

                    // where to redirect to after login
                    RedirectUris = { "https://localhost:5021/signin-oidc" },

                    // where to redirect to after logout
                    PostLogoutRedirectUris = { "https://localhost:5021/signout-callback-oidc" },

                    AllowedScopes = new List<string>
                    {
                        IdentityServerConstants.StandardScopes.OpenId,
                        IdentityServerConstants.StandardScopes.Profile,
                        IdentityServerConstants.StandardScopes.Email,

                        // apis
                        "maw_api",

                        // identity resources
                        JwtClaimTypes.Role
                    },
                    AllowOfflineAccess = true
                },
                new Client
                {
                    ClientId = "maw_photos_android",
                    ClientName = "<NAME>",
                    AllowedGrantTypes = GrantTypes.Code,
                    RequireConsent = false,
                    RequireClientSecret = false,
                    RequirePkce = true,

                    // where to redirect to after login
                    RedirectUris = { "us.mikeandwan.photos:/signin-oidc" },

                    AllowedScopes = new List<string>
                    {
                        IdentityServerConstants.StandardScopes.OpenId,
                        IdentityServerConstants.StandardScopes.Email,

                        // apis
                        "maw_api",

                        // identity resources
                        JwtClaimTypes.Role
                    },
                    AllowOfflineAccess = true
                }
            };
        }
    }
}
{'fraction_non_alphanumeric': 0.06815436454955814, 'fraction_numerical': 0.011698137198804755, 'mean_word_length': 0.9045889332849013, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 51, 'https://': 28, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5242950', 'n_tokens_mistral': 3720, 'n_tokens_neox': 3201, 'n_words': 612}