NewDefaultDeviceCodeFlow provides an easy way to build up a default device code flow with all the correct configuration. If refresh tokens should be allowed pass in true for
(options DeviceCodeFlowOptions, callback DeviceCodeCallback)
| 80 | // device code flow with all the correct configuration. If refresh tokens should |
| 81 | // be allowed pass in true for <allowRefresh> |
| 82 | func NewDefaultDeviceCodeFlow(options DeviceCodeFlowOptions, |
| 83 | callback DeviceCodeCallback) (*DeviceCodeFlow, error) { |
| 84 | wellKnownEndpoints, err := GetOIDCWellKnownEndpointsFromIssuerURL(options.IssuerEndpoint) |
| 85 | if err != nil { |
| 86 | return nil, err |
| 87 | } |
| 88 | |
| 89 | codeProvider := NewLocalDeviceCodeProvider( |
| 90 | LocalDeviceCodeProviderOptions{ |
| 91 | ClientID: options.ClientID, |
| 92 | }, |
| 93 | *wellKnownEndpoints, |
| 94 | &http.Client{}, |
| 95 | ) |
| 96 | |
| 97 | tokenRetriever := NewTokenRetriever(&http.Client{}) |
| 98 | |
| 99 | return newDeviceCodeFlow( |
| 100 | options, |
| 101 | *wellKnownEndpoints, |
| 102 | codeProvider, |
| 103 | tokenRetriever, |
| 104 | callback, |
| 105 | clock.RealClock{}), nil |
| 106 | } |
| 107 | |
| 108 | var _ Flow = &DeviceCodeFlow{} |
| 109 |
nothing calls this directly
no test coverage detected
searching dependent graphs…