OIDC with Discord #6355
-
Hi, I recently setup OIDC with discord and thought other people would be interested! Quick summary of my installation:I use NixOS for all my machines so installing outline in itself is as simple as filling the information below: services.outline = {
enable = cfg.enable;
publicUrl = "https://${cfg.url}";
port = cfg.port;
storage.storageType = "local";
forceHttps = false;
oidcAuthentication = {
authUrl = "https://discordapp.com/api/oauth2/authorize";
tokenUrl = "https://discordapp.com/api/oauth2/token";
userinfoUrl = "https://discordapp.com/api/users/@me";
clientId = "1170421650861334618";
clientSecretFile = "/secrets/outline-client-secret-key";
scopes = [ "email" "identify" ];
usernameClaim = "preferred_username";
displayName = "Discord";
};
}; Setting up discord OIDCWhat interests us here is the The To find your clientId and clientSecret, you first have to go to Discord's Developer Portal, in the applications category. Once there create a new application. Once it is done, go to the OAuth2 tab on the left: Once there you will find your clientID and clientSecret (you may need to reset it to generate it). Don't forget to add a callback link like I did to redirect back to your outline domain, it should be in the shape of And then you're all set ! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Thank you @Conquerix for sharing this guide! I really think this could be helpful to have in the official documentation. I can confirm that the above instructions produce the desired result of authentication with Discord. For those of us unfamiliar with Nix OS, I've included the relevant lines from my .env file below. The client id and secret should be replaced with those from your discord app, but the rest can be used without any tweaks.
|
Beta Was this translation helpful? Give feedback.
-
Hello. Now when I try to log in I get an error: Invalid key length
|
Beta Was this translation helpful? Give feedback.
Thank you @Conquerix for sharing this guide! I really think this could be helpful to have in the official documentation.
I can confirm that the above instructions produce the desired result of authentication with Discord.
For those of us unfamiliar with Nix OS, I've included the relevant lines from my .env file below. The client id and secret should be replaced with those from your discord app, but the rest can be used without any tweaks.