AzureAD / microsoft-authentication-library-for-go

The MSAL library for Go is part of the Microsoft identity platform for developers (formerly named Azure AD) v2.0. It enables you to acquire security tokens to call protected APIs. It uses industry standard OAuth2 and OpenID Connect.
MIT License
218 stars 87 forks source link

Can't unmarshal a partitioned cache #455

Open chlowell opened 10 months ago

chlowell commented 10 months ago

Easy to repro with a unit test in partitioned_storage_test.go:

func TestMarshal(t *testing.T) {
    mgr := newPartitionedManagerForTest(nil)
    b, err := mgr.Marshal()
    if err != nil {
        t.Fatal(err)
    }
    err = mgr.Unmarshal(b)
    if err != nil {
        t.Fatal(err)
    }
}

Unmarshal returns the error Unmarshal(*storage.InMemoryContract) only supports structs that have the field AdditionalFields or implements json.Unmarshaler. And that's spot on, storage.InMemoryContract doesn't have an AdditionalFields field.

bgavrilMS commented 5 months ago

Solved by https://github.com/AzureAD/microsoft-authentication-library-for-go/pull/456

chlowell commented 4 months ago

Reopening because #456 didn't merge and it's still impossible to unmarshal a partitioned cache