According to (online) Merriam-Webster, “may” has the following two distinct definitions, among others
1 b: have permission to
4: SHALL, MUST —used in law where the sense, purpose, or policy requires this interpretation
Oxford dictionary does not seem to have the definition of may = shall, must.
What is the history of may being used to mean “must”?