By: Ha Ro user 26 Jun 2020 at 7:07 p.m. CDT

5 Responses
Ha Ro gravatar
Hopefully folks can help point me in the right direction so I can figure it out. I figured it out in Miniorange, but need it working in Gluu instead. Desired: Pre-created custom user attribute in Gluu, "discordUid" is auto-filled from Discord User_id during User OAuth/Passport Authentication between Gluu 3.1.6 and Discord. Steps: User lands on the Gluu login page. The page includes the External Providers option with a Passport option to login with Discord (working). User clicks that Discord link, authorizes the Gluu 3.1.6, and user is logged into both Gluu and Discord (working). While doing that authorization process, Gluu user attribute (already created on the server), is populated with the Discord unique username id. (not working in Gluu - did get working in miniorange for learning, but need to get this working directly between Gluu and Discord without the miniorange middle-ware). I already created custom user attribute discordUid on the server. It is text and blank by default. The goal is that any user that goes through the Discord Authentication has that field populated with their unique discord user_id username id number, as per here: https://discord.com/developers/docs/reference . When working, such as in Miniorange, it looks like this: 720923259763425320 (normal username is email, and in discord chatrooms looks like: tfndiscordtest1#3093 This is using Gluu 3.1.6 on Ubuntu 16.04 LTS. In Gluu 4 I see easy attribute mapping in the web UI, but I'm having trouble finding documentation to explain how I should do attribute mapping of (Discord ID) id > discordUid (manually created Gluu user attribute). Could someone point me to the correct resource to do this with 3.1.6? (or else provide a quick pointer here on the process for doing this. Thanks! In mini-orange there is Attribute mapping feature: miniOrange OAuth > Edit Application > Attribute Mapping > Map Custom Attributes > id -> discordUid For miniorange middleware example: https://wp.rpgr.org/logoutlanding1/ click on Gluu316WpDiscordUid1 link is: https://devau.thefantasy.network/oxauth/authorize.htm?scope=openid+email+profile+permission+user_name+discordUid&response_type=code&redirect_uri=https%3A%2F%2Fwp.rpgr.org&state=eyI2MTcwNzA2ZTYxNmQ2NSI6eyJWIjoiNDc2Yzc1NzUzMzMxMzY1NzcwNDQ2OTczNjM2ZjcyNjQ1NTY5NjQzMSIsIkgiOiJhMTU5MWVlN2Y1M2NmYThhNGEzYjM5MTNiNTk3ZjRlOSJ9LCI3MjY1NjQ2OTcyNjU2Mzc0NWY3NTcyNjkiOnsiViI6IjY4NzQ3NDcwNzMzYTJmMmY3NzcwMmU3MjcwNjc3MjJlNmY3MjY3IiwiSCI6Ijc0MDhlYTVmNThjNzJhYjI1YTMzM2RiNzBhZDE0OTIwIn0sIjc1Njk2NCI6eyJWIjoiNDQ0NjM4NTY0YjRhNGYzNTQ2NDQ0ODVhNDE1MjQyNTIzNTVhNDQ1MzMyNTYzNTRhMzYzNjU1MzI0ZTQ0NTIiLCJIIjoiOGE1NzlkN2M4NGM5ODRkNWE4MGY0YzZiOGYwZDQ2OWMifX0%3D&client_id=%40%21DA50.1A15.0388.CAC8%210001%21A8D0.2AEA%210008%21A54A.1776.3AA0.591F Fields in "Test Configuration" result: Test Configuration Attribute Name Attribute Value id 713172580369956965 username tfndiscordtest1 avatar discriminator 3093 public_flags 0 flags 0 email discordtest1@rpgr.org verified locale en-US mfa_enabled OAuth Permission Dialog example: Request for Permission Gluu316WpDiscordUid1 is requesting permission to do the following: * Discord User ID * Authenticate using OpenID Connect. * View your local username in the Gluu Server. * View your email address. If I go to Open ID Connect > Scopes. I see where I can create a custom scope. For this interaction between Discord and Gluu, should I set the Scope Type to OAuth or OpenID? I set to OpenID for now. Should I allow for dynamic registration? For now I set to False. Display name: discorduid. iNum: @!DA50.1A15.0388.CAC8!0001!A8D0.2AEA!0009!658A.E018 Not sure what I am supposed to do with the "add claim" will look for docs about that. Left blank for now. Or should I be doing all of this through customization manually of the discord.js passport file? Thanks for any guidance! EDIT: I found this: https://gluu.org/docs/gluu-server/3.1.6/admin-guide/openid-connect/#customizing-scopes and set claim to find discordUid attribute. Is that on the right track? https://discord.com/developers/docs/resources/user#user-object

By Mohib Zico staff 27 Jun 2020 at 2:18 a.m. CDT

Mohib Zico gravatar
Hi, I'll be honest ... this ticket is little beyond community support as we don't have access to discord and none of our customer asked for Discord integration with Gluu Server passport. So..whatever we are saying here... we are mostly getting 'an image' from your description; so please pardon us if something is not correct. >> EDIT: I found this: https://gluu.org/docs/gluu-server/3.1.6/admin-guide/openid-connect/#customizing-scopes and set claim to find discordUid attribute. Is that on the right track? I believe you can try that.

By Ha Ro user 27 Jun 2020 at 6:10 a.m. CDT

Ha Ro gravatar
If there is anyone that can help me, even if quick billable. This is just grabbing the text string from the "identify" scope, the user id number from the Discord server. Desperate here, so if someone wants to help as billable, please let me know. Whole project is about to implode today over this last little step. :-( Took so long to get the prior step working (a month to get the passport-discord.js), but that is now working as of this week. So anyone that can help me get this last step, please let me know. I have been doing this all as volunteer work, but I'll scrape up what I can out of my own pocket if someone can help me get across this last step. Thanks,. Not trying to get image. Just string from "identify" scope user information from the Oauth transaction from the Discord server. Then just populate Gluu user custom attribute from that information. The information is there during Oauth transaction as proven by miniorange, but need to figure out how to get that to work with Gluu. Please, anyone can help, please contact me ASAP. USA Phone: (509) 608-7630 (text works too. Skype: dev2devportal. Email: rpgresearcher@gmail.com

By Mohib Zico staff 27 Jun 2020 at 6:24 a.m. CDT

Mohib Zico gravatar
I think someone introduced you to one of our integration partner. You might wanna contact them.

By Ha Ro user 27 Jun 2020 at 7:24 a.m. CDT

Ha Ro gravatar
Okay. Will share results if able to get working. Discord is immensely popular (though I don't like it), so will be helpful for others when figured out. WIll update here once have info.

By Ha Ro user 27 Jun 2020 at 9:33 a.m. CDT

Ha Ro gravatar
Thank goodness Jajati and team at Centroxy were able to help last minute. Have working prototype now working. I don't have all the details on how it was done yet, it was late evening weekend for them in India, so needed to let him go, but in a couple days will share the information on getting this working. So I won't close this out yet until I can post the solution. This was a real timeline nail biter. Phew!