-
Notifications
You must be signed in to change notification settings - Fork 126
use new auth system when dialing, refactor auth #338
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
base: master
Are you sure you want to change the base?
Conversation
GameParrot
commented
Aug 28, 2025
- Support for new auth system when connecting to servers (TODO: support for offline logins and parsing the new token field)
- new session.Session for reusing tokens between logins
- new auth.XblTokenObtainer for reusing a device token
- Support for authenticating with platforms other than Android
Sandertv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! I have taken a brief look and left a couple of comments, most of those are easily resolved.
I have some concerns over the session package, which I think is named rather unfortunately. By itself, session is not clear at all when it comes to what it refers to. session.Session does not make that any clearer. I think putting session.go in the auth package, so that referring to it becomes auth.Session, would be much more understandable and straightforward.
I am also not a huge fan of the franchise name for the respective package, since again, it isn't particularly clear to anyone unfamiliar with the code what this means. Is there any more concrete name we could give it? And is it so strongly related to authentication that it might be better placed within the auth package? (as a subpackage?)
| type Device struct { | ||
| ClientID string | ||
| DeviceType string | ||
| Version string | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please document this
TwistedAsylumMC
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I caught everything, but it's mostly just missing documentation and grammer that's needed for this. As well as removing any test code (specifically main.go) and fixing up the last TODO. Would be great to get this merged, so let me know if you need any help
|
|
||
| var discovered = map[string]*Discovery{} | ||
|
|
||
| func Discover(build string) (*Discovery, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs would be great
| return result.Data, nil | ||
| } | ||
|
|
||
| type Discovery struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs would be great
| SupportedEnvironments map[string][]string `json:"supportedEnvironments"` | ||
| } | ||
|
|
||
| func (d *Discovery) Environment(env Environment, typ string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs would be great
| "golang.org/x/text/language" | ||
| ) | ||
|
|
||
| type Session struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs would be great
| return s, nil | ||
| } | ||
|
|
||
| func (s *Session) login(ctx context.Context) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs would be great
| return s.obtainMcToken(ctx) | ||
| } | ||
|
|
||
| func (s *Session) initDiscovery() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs would be great
| return nil | ||
| } | ||
|
|
||
| func (s *Session) loginWithPlayfab(ctx context.Context) (err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs would be great
| return nil | ||
| } | ||
|
|
||
| func (s *Session) obtainMcToken(ctx context.Context) (err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs would be great
|
can someone write up a list of what needs to still occur on this pr |